version 1.272, 2008/05/05 17:11:17 |
version 1.272.2.2, 2008/10/10 22:35:43 |
|
|
|
|
#define IPQ_UNLOCK() ipq_unlock() |
#define IPQ_UNLOCK() ipq_unlock() |
|
|
POOL_INIT(inmulti_pool, sizeof(struct in_multi), 0, 0, 0, "inmltpl", NULL, |
struct pool inmulti_pool; |
IPL_SOFTNET); |
struct pool ipqent_pool; |
POOL_INIT(ipqent_pool, sizeof(struct ipqent), 0, 0, 0, "ipqepl", NULL, |
|
IPL_VM); |
|
|
|
#ifdef INET_CSUM_COUNTERS |
#ifdef INET_CSUM_COUNTERS |
#include <sys/device.h> |
#include <sys/device.h> |
|
|
const struct protosw *pr; |
const struct protosw *pr; |
int i; |
int i; |
|
|
|
pool_init(&inmulti_pool, sizeof(struct in_multi), 0, 0, 0, "inmltpl", |
|
NULL, IPL_SOFTNET); |
|
pool_init(&ipqent_pool, sizeof(struct ipqent), 0, 0, 0, "ipqepl", |
|
NULL, IPL_VM); |
|
|
pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); |
pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); |
if (pr == 0) |
if (pr == 0) |
panic("ip_init"); |
panic("ip_init"); |
Line 1967 ip_forward(struct mbuf *m, int srcrt) |
|
Line 1970 ip_forward(struct mbuf *m, int srcrt) |
|
type = ICMP_UNREACH; |
type = ICMP_UNREACH; |
code = ICMP_UNREACH_NEEDFRAG; |
code = ICMP_UNREACH_NEEDFRAG; |
|
|
if ((rt = rtcache_validate(&ipforward_rt)) != NULL) { |
if ((rt = rtcache_validate(&ipforward_rt)) != NULL) |
|
destmtu = rt->rt_ifp->if_mtu; |
|
|
#if defined(IPSEC) || defined(FAST_IPSEC) |
#if defined(IPSEC) || defined(FAST_IPSEC) |
|
{ |
/* |
/* |
* If the packet is routed over IPsec tunnel, tell the |
* If the packet is routed over IPsec tunnel, tell the |
* originator the tunnel MTU. |
* originator the tunnel MTU. |
Line 1985 ip_forward(struct mbuf *m, int srcrt) |
|
Line 1990 ip_forward(struct mbuf *m, int srcrt) |
|
sp = ipsec4_getpolicybyaddr(mcopy, |
sp = ipsec4_getpolicybyaddr(mcopy, |
IPSEC_DIR_OUTBOUND, IP_FORWARDING, |
IPSEC_DIR_OUTBOUND, IP_FORWARDING, |
&ipsecerror); |
&ipsecerror); |
#endif |
|
|
|
destmtu = rt->rt_ifp->if_mtu; |
|
#if defined(IPSEC) || defined(FAST_IPSEC) |
|
if (sp != NULL) { |
if (sp != NULL) { |
/* count IPsec header size */ |
/* count IPsec header size */ |
ipsechdr = ipsec4_hdrsiz(mcopy, |
ipsechdr = ipsec4_hdrsiz(mcopy, |
Line 2003 ip_forward(struct mbuf *m, int srcrt) |
|
Line 2005 ip_forward(struct mbuf *m, int srcrt) |
|
&& sp->req->sav != NULL |
&& sp->req->sav != NULL |
&& sp->req->sav->sah != NULL) { |
&& sp->req->sav->sah != NULL) { |
ro = &sp->req->sav->sah->sa_route; |
ro = &sp->req->sav->sah->sa_route; |
|
rt = rtcache_validate(ro); |
if (rt && rt->rt_ifp) { |
if (rt && rt->rt_ifp) { |
destmtu = |
destmtu = |
rt->rt_rmx.rmx_mtu ? |
rt->rt_rmx.rmx_mtu ? |
Line 2018 ip_forward(struct mbuf *m, int srcrt) |
|
Line 2021 ip_forward(struct mbuf *m, int srcrt) |
|
KEY_FREESP(&sp); |
KEY_FREESP(&sp); |
#endif |
#endif |
} |
} |
#endif /*defined(IPSEC) || defined(FAST_IPSEC)*/ |
|
} |
} |
|
#endif /*defined(IPSEC) || defined(FAST_IPSEC)*/ |
IP_STATINC(IP_STAT_CANTFRAG); |
IP_STATINC(IP_STAT_CANTFRAG); |
break; |
break; |
|
|
Line 2143 sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS |
|
Line 2146 sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS |
|
if (tmp < 0) |
if (tmp < 0) |
return (EINVAL); |
return (EINVAL); |
|
|
|
mutex_enter(softnet_lock); |
|
|
ip_mtudisc_timeout = tmp; |
ip_mtudisc_timeout = tmp; |
rt_timer_queue_change(ip_mtudisc_timeout_q, ip_mtudisc_timeout); |
rt_timer_queue_change(ip_mtudisc_timeout_q, ip_mtudisc_timeout); |
|
|
|
mutex_exit(softnet_lock); |
|
|
return (0); |
return (0); |
} |
} |
|
|
Line 2156 sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS |
|
Line 2163 sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS |
|
static int |
static int |
sysctl_net_inet_ip_maxflows(SYSCTLFN_ARGS) |
sysctl_net_inet_ip_maxflows(SYSCTLFN_ARGS) |
{ |
{ |
int s; |
int error; |
|
|
s = sysctl_lookup(SYSCTLFN_CALL(rnode)); |
error = sysctl_lookup(SYSCTLFN_CALL(rnode)); |
if (s || newp == NULL) |
if (error || newp == NULL) |
return (s); |
return (error); |
|
|
|
mutex_enter(softnet_lock); |
|
KERNEL_LOCK(1, NULL); |
|
|
s = splsoftnet(); |
|
ipflow_prune(); |
ipflow_prune(); |
splx(s); |
|
|
KERNEL_UNLOCK_ONE(NULL); |
|
mutex_exit(softnet_lock); |
|
|
return (0); |
return (0); |
} |
} |
Line 2186 sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG |
|
Line 2197 sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG |
|
/* |
/* |
* Can only fail due to malloc() |
* Can only fail due to malloc() |
*/ |
*/ |
if (ipflow_invalidate_all(tmp)) |
mutex_enter(softnet_lock); |
return ENOMEM; |
KERNEL_LOCK(1, NULL); |
|
|
|
error = ipflow_invalidate_all(tmp); |
|
|
|
KERNEL_UNLOCK_ONE(NULL); |
|
mutex_exit(softnet_lock); |
|
|
} else { |
} else { |
/* |
/* |
* EINVAL if not a power of 2 |
* EINVAL if not a power of 2 |
*/ |
*/ |
return EINVAL; |
error = EINVAL; |
} |
} |
|
|
return (0); |
return error; |
} |
} |
#endif /* GATEWAY */ |
#endif /* GATEWAY */ |
|
|