diff options
author | bz <bz@FreeBSD.org> | 2009-06-12 20:46:36 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2009-06-12 20:46:36 +0000 |
commit | 64d1a840734da28ba4d1f2510cb98a5c811446f0 (patch) | |
tree | 5ff1b55ac9b7429ea017f9890d322a9ffbd67ae6 /sys/netinet | |
parent | 0e4ff69bbaf0a890087aaa913e3afc146145e5d5 (diff) | |
download | FreeBSD-src-64d1a840734da28ba4d1f2510cb98a5c811446f0.zip FreeBSD-src-64d1a840734da28ba4d1f2510cb98a5c811446f0.tar.gz |
Move the kernel option FLOWTABLE chacking from the header file to the
actual implementation.
Remove the accessor functions for the compiled out case, just returning
"unavail" values. Remove the kernel conditional from the header file as
it is no longer needed, only leaving the externs.
Hide the improperly virtualized SYSCTL/TUNABLE for the flowtable size
under the kernel option as well.
Reviewed by: rwatson
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_input.c | 7 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index bdc0c6d..6af99b1 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -206,16 +206,19 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW, ipstealth, 0, "IP stealth mode, no TTL decrementation on forwarding"); #endif +#ifdef FLOWTABLE static int ip_output_flowtable_size = 2048; TUNABLE_INT("net.inet.ip.output_flowtable_size", &ip_output_flowtable_size); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, output_flowtable_size, CTLFLAG_RDTUN, ip_output_flowtable_size, 2048, "number of entries in the per-cpu output flow caches"); +struct flowtable *ip_ft; +#endif + #ifdef VIMAGE_GLOBALS int fw_one_pass; #endif -struct flowtable *ip_ft; static void ip_freef(struct ipqhead *, struct ipq *); @@ -374,7 +377,9 @@ ip_init(void) /* Initialize various other remaining things. */ IPQ_LOCK_INIT(); netisr_register(&ip_nh); +#ifdef FLOWTABLE ip_ft = flowtable_alloc(ip_output_flowtable_size, FL_PCPU); +#endif } void diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index fbc5d05..bbc9a8b 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -155,6 +155,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, ro = &iproute; bzero(ro, sizeof (*ro)); +#ifdef FLOWTABLE /* * The flow table returns route entries valid for up to 30 * seconds; we rely on the remainder of ip_output() taking no @@ -163,6 +164,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, */ if (flowtable_lookup(ip_ft, m, ro) == 0) nortfree = 1; +#endif } if (opt) { |