diff options
author | bz <bz@FreeBSD.org> | 2011-04-27 19:36:35 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2011-04-27 19:36:35 +0000 |
commit | 65657fce6578ef31040fa2321c2090efc54e9ebf (patch) | |
tree | 2b3942a26d82b926715eea5d8709306d0ae46fdb | |
parent | 26a10f219568393dd25f0b6701ea777f9af29281 (diff) | |
download | FreeBSD-src-65657fce6578ef31040fa2321c2090efc54e9ebf.zip FreeBSD-src-65657fce6578ef31040fa2321c2090efc54e9ebf.tar.gz |
MfP4 CH=192029:
Expose ip_icmp.c to INET6 as well and only export badport_bandlim()
along with the two sysctls in the non-INET case.
The bandlim types work for all cases I reviewed in IPv6 as well and
the sysctls are available as we export net.inet.* from in_proto.c.
Reviewed by: gnn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 4 days
-rw-r--r-- | sys/conf/files | 2 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.c | 29 |
2 files changed, 18 insertions, 13 deletions
diff --git a/sys/conf/files b/sys/conf/files index a23ff56..104462b 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2707,7 +2707,7 @@ netinet/ipfw/ip_fw_pfil.c optional inet ipfirewall netinet/ipfw/ip_fw_sockopt.c optional inet ipfirewall netinet/ipfw/ip_fw_table.c optional inet ipfirewall netinet/ipfw/ip_fw_nat.c optional inet ipfirewall_nat -netinet/ip_icmp.c optional inet +netinet/ip_icmp.c optional inet | inet6 netinet/ip_input.c optional inet netinet/ip_ipsec.c optional inet ipsec netinet/ip_mroute.c optional mrouting inet | mrouting inet6 diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 480a2c8..3542aa1 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -32,6 +32,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_ipsec.h" #include <sys/param.h> @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include <netinet/tcpip.h> #include <netinet/icmp_var.h> +#ifdef INET #ifdef IPSEC #include <netipsec/ipsec.h> #include <netipsec/key.h> @@ -70,12 +72,26 @@ __FBSDID("$FreeBSD$"); #include <machine/in_cksum.h> #include <security/mac/mac_framework.h> +#endif /* INET */ /* * ICMP routines: error generation, receive packet processing, and * routines to turnaround packets back to the originator, and * host table maintenance routines. */ +static VNET_DEFINE(int, icmplim) = 200; +#define V_icmplim VNET(icmplim) +SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW, + &VNET_NAME(icmplim), 0, + "Maximum number of ICMP responses per second"); + +static VNET_DEFINE(int, icmplim_output) = 1; +#define V_icmplim_output VNET(icmplim_output) +SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, + &VNET_NAME(icmplim_output), 0, + "Enable rate limiting of ICMP responses"); + +#ifdef INET VNET_DEFINE(struct icmpstat, icmpstat); SYSCTL_VNET_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(icmpstat), icmpstat, ""); @@ -104,18 +120,6 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW, &VNET_NAME(log_redirect), 0, "Log ICMP redirects to the console"); -static VNET_DEFINE(int, icmplim) = 200; -#define V_icmplim VNET(icmplim) -SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW, - &VNET_NAME(icmplim), 0, - "Maximum number of ICMP responses per second"); - -static VNET_DEFINE(int, icmplim_output) = 1; -#define V_icmplim_output VNET(icmplim_output) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, - &VNET_NAME(icmplim_output), 0, - "Enable rate limiting of ICMP responses"); - static VNET_DEFINE(char, reply_src[IFNAMSIZ]); #define V_reply_src VNET(reply_src) SYSCTL_VNET_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_RW, @@ -922,6 +926,7 @@ ip_next_mtu(int mtu, int dir) } return 0; } +#endif /* INET */ /* |