version 1.278.2.2, 2009/07/23 23:32:48 |
version 1.279, 2009/03/18 17:06:52 |
Line 1562 ip_dooptions(struct mbuf *m) |
|
Line 1562 ip_dooptions(struct mbuf *m) |
|
/* |
/* |
* locate outgoing interface |
* locate outgoing interface |
*/ |
*/ |
memcpy((void *)&ipaddr.sin_addr, (void *)(cp + off), |
memcpy( (void *)&ipaddr.sin_addr, (void *)(cp + off), |
sizeof(ipaddr.sin_addr)); |
sizeof(ipaddr.sin_addr)); |
if (opt == IPOPT_SSRR) |
if (opt == IPOPT_SSRR) |
ia = ifatoia(ifa_ifwithladdr(sintosa(&ipaddr))); |
ia = ifatoia(ifa_ifwithladdr(sintosa(&ipaddr))); |
Line 1598 ip_dooptions(struct mbuf *m) |
|
Line 1598 ip_dooptions(struct mbuf *m) |
|
off--; /* 0 origin */ |
off--; /* 0 origin */ |
if ((off + sizeof(struct in_addr)) > optlen) |
if ((off + sizeof(struct in_addr)) > optlen) |
break; |
break; |
memcpy((void *)&ipaddr.sin_addr, (void *)(&ip->ip_dst), |
memcpy( (void *)&ipaddr.sin_addr, (void *)(&ip->ip_dst), |
sizeof(ipaddr.sin_addr)); |
sizeof(ipaddr.sin_addr)); |
/* |
/* |
* locate outgoing interface; if we're the destination, |
* locate outgoing interface; if we're the destination, |
Line 1665 ip_dooptions(struct mbuf *m) |
|
Line 1665 ip_dooptions(struct mbuf *m) |
|
(u_char *)ip; |
(u_char *)ip; |
goto bad; |
goto bad; |
} |
} |
memcpy(&ipaddr.sin_addr, cp0, |
memcpy( &ipaddr.sin_addr, cp0, |
sizeof(struct in_addr)); |
sizeof(struct in_addr)); |
if (ifatoia(ifa_ifwithaddr(sintosa(&ipaddr))) |
if (ifatoia(ifa_ifwithaddr(sintosa(&ipaddr))) |
== NULL) |
== NULL) |
Line 1739 save_rte(u_char *option, struct in_addr |
|
Line 1739 save_rte(u_char *option, struct in_addr |
|
#endif /* 0 */ |
#endif /* 0 */ |
if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst))) |
if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst))) |
return; |
return; |
memcpy((void *)ip_srcrt.srcopt, (void *)option, olen); |
memcpy( (void *)ip_srcrt.srcopt, (void *)option, olen); |
ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr); |
ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr); |
ip_srcrt.dst = dst; |
ip_srcrt.dst = dst; |
} |
} |
Line 2057 ip_savecontrol(struct inpcb *inp, struct |
|
Line 2057 ip_savecontrol(struct inpcb *inp, struct |
|
struct mbuf *m) |
struct mbuf *m) |
{ |
{ |
|
|
if (inp->inp_socket->so_options & SO_TIMESTAMP |
if (inp->inp_socket->so_options & SO_TIMESTAMP |
#ifdef SO_OTIMESTAMP |
#ifdef SO_OTIMESTAMP |
|| inp->inp_socket->so_options & SO_OTIMESTAMP |
|| inp->inp_socket->so_options & SO_OTIMESTAMP |
#endif |
#endif |
) { |
) { |
struct timeval tv; |
struct timeval tv; |
Line 2118 ip_savecontrol(struct inpcb *inp, struct |
|
Line 2118 ip_savecontrol(struct inpcb *inp, struct |
|
if (*mp) |
if (*mp) |
mp = &(*mp)->m_next; |
mp = &(*mp)->m_next; |
} |
} |
if (inp->inp_flags & INP_RECVTTL) { |
|
*mp = sbcreatecontrol((void *) &ip->ip_ttl, |
|
sizeof(uint8_t), IP_RECVTTL, IPPROTO_IP); |
|
if (*mp) |
|
mp = &(*mp)->m_next; |
|
} |
|
} |
} |
|
|
/* |
/* |
Line 2142 sysctl_net_inet_ip_forwsrcrt(SYSCTLFN_AR |
|
Line 2136 sysctl_net_inet_ip_forwsrcrt(SYSCTLFN_AR |
|
if (error || newp == NULL) |
if (error || newp == NULL) |
return (error); |
return (error); |
|
|
error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_FORWSRCRT, |
if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_FORWSRCRT, |
0, NULL, NULL, NULL); |
0, NULL, NULL, NULL)) |
if (error) |
return (EPERM); |
return (error); |
|
|
|
ip_forwsrcrt = tmp; |
ip_forwsrcrt = tmp; |
|
|
Line 2207 sysctl_net_inet_ip_maxflows(SYSCTLFN_ARG |
|
Line 2200 sysctl_net_inet_ip_maxflows(SYSCTLFN_ARG |
|
|
|
static int |
static int |
sysctl_net_inet_ip_hashsize(SYSCTLFN_ARGS) |
sysctl_net_inet_ip_hashsize(SYSCTLFN_ARGS) |
{ |
{ |
int error, tmp; |
int error, tmp; |
struct sysctlnode node; |
struct sysctlnode node; |
|
|
Line 2235 sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG |
|
Line 2228 sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG |
|
* EINVAL if not a power of 2 |
* EINVAL if not a power of 2 |
*/ |
*/ |
error = EINVAL; |
error = EINVAL; |
} |
} |
|
|
return error; |
return error; |
} |
} |