| version 1.250, 2007/07/19 20:48:55 |
version 1.250.4.5, 2007/11/11 16:48:31 |
|
|
| splx(s); |
splx(s); |
| if (m == 0) |
if (m == 0) |
| return; |
return; |
| MCLAIM(m, &ip_rx_mowner); |
|
| ip_input(m); |
ip_input(m); |
| } |
} |
| } |
} |
|
|
| /* XXX error stat??? */ |
/* XXX error stat??? */ |
| error = EINVAL; |
error = EINVAL; |
| DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ |
DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ |
| goto bad; |
|
| } |
} |
| splx(s); |
splx(s); |
| if (error) |
if (error) |
| Line 1777 ip_srcroute(void) |
|
| Line 1775 ip_srcroute(void) |
|
| return (m); |
return (m); |
| } |
} |
| |
|
| /* |
|
| * Strip out IP options, at higher |
|
| * level protocol in the kernel. |
|
| * Second argument is buffer to which options |
|
| * will be moved, and return value is their length. |
|
| * XXX should be deleted; last arg currently ignored. |
|
| */ |
|
| void |
|
| ip_stripoptions(struct mbuf *m, struct mbuf *mopt) |
|
| { |
|
| int i; |
|
| struct ip *ip = mtod(m, struct ip *); |
|
| void *opts; |
|
| int olen; |
|
| |
|
| olen = (ip->ip_hl << 2) - sizeof (struct ip); |
|
| opts = (void *)(ip + 1); |
|
| i = m->m_len - (sizeof (struct ip) + olen); |
|
| memmove(opts, (char *)opts + olen, (unsigned)i); |
|
| m->m_len -= olen; |
|
| if (m->m_flags & M_PKTHDR) |
|
| m->m_pkthdr.len -= olen; |
|
| ip->ip_len = htons(ntohs(ip->ip_len) - olen); |
|
| ip->ip_hl = sizeof (struct ip) >> 2; |
|
| } |
|
| |
|
| const int inetctlerrmap[PRC_NCMDS] = { |
const int inetctlerrmap[PRC_NCMDS] = { |
| 0, 0, 0, 0, |
0, 0, 0, 0, |
| 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, |
0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, |
| Line 2079 ip_savecontrol(struct inpcb *inp, struct |
|
| Line 2051 ip_savecontrol(struct inpcb *inp, struct |
|
| if (inp->inp_flags & INP_RECVIF) { |
if (inp->inp_flags & INP_RECVIF) { |
| struct sockaddr_dl sdl; |
struct sockaddr_dl sdl; |
| |
|
| sdl.sdl_len = offsetof(struct sockaddr_dl, sdl_data[0]); |
sockaddr_dl_init(&sdl, sizeof(sdl), |
| sdl.sdl_family = AF_LINK; |
(m->m_pkthdr.rcvif != NULL) |
| sdl.sdl_index = m->m_pkthdr.rcvif ? |
? m->m_pkthdr.rcvif->if_index |
| m->m_pkthdr.rcvif->if_index : 0; |
: 0, |
| sdl.sdl_nlen = sdl.sdl_alen = sdl.sdl_slen = 0; |
0, NULL, 0, NULL, 0); |
| *mp = sbcreatecontrol((void *) &sdl, sdl.sdl_len, |
*mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP); |
| IP_RECVIF, IPPROTO_IP); |
|
| if (*mp) |
if (*mp) |
| mp = &(*mp)->m_next; |
mp = &(*mp)->m_next; |
| } |
} |