| version 1.250.4.6, 2007/11/27 19:38:57 |
version 1.251, 2007/08/10 22:46:16 |
|
|
| 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 1775 ip_srcroute(void) |
|
| Line 1777 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] = { |
| [PRC_MSGSIZE] = EMSGSIZE, |
0, 0, 0, 0, |
| [PRC_HOSTDEAD] = EHOSTDOWN, |
0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, |
| [PRC_HOSTUNREACH] = EHOSTUNREACH, |
EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, |
| [PRC_UNREACH_NET] = EHOSTUNREACH, |
EMSGSIZE, EHOSTUNREACH, 0, 0, |
| [PRC_UNREACH_HOST] = EHOSTUNREACH, |
0, 0, 0, 0, |
| [PRC_UNREACH_PROTOCOL] = ECONNREFUSED, |
ENOPROTOOPT |
| [PRC_UNREACH_PORT] = ECONNREFUSED, |
|
| [PRC_UNREACH_SRCFAIL] = EHOSTUNREACH, |
|
| [PRC_PARAMPROB] = ENOPROTOOPT, |
|
| }; |
}; |
| |
|
| /* |
/* |
| Line 2054 ip_savecontrol(struct inpcb *inp, struct |
|
| Line 2079 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; |
| |
|
| sockaddr_dl_init(&sdl, sizeof(sdl), |
sockaddr_dl_init(&sdl, (m->m_pkthdr.rcvif != NULL) ? |
| (m->m_pkthdr.rcvif != NULL) |
m->m_pkthdr.rcvif->if_index : 0, 0, NULL, 0, NULL, 0); |
| ? m->m_pkthdr.rcvif->if_index |
|
| : 0, |
|
| 0, NULL, 0, NULL, 0); |
|
| *mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP); |
*mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP); |
| if (*mp) |
if (*mp) |
| mp = &(*mp)->m_next; |
mp = &(*mp)->m_next; |