From 336d023b2ed22064b0e800275fcf7e385f3d4d03 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Sun, 17 Apr 2011 16:35:16 +0000 Subject: [PATCH] Make in_proto.c dependent on either inet or inet6. While it does not provide any functionality for IPv6, it provides the sysctl nodes for net.inet.* that a lot of functionality shared between IPv4 and IPv6 depends on. We cannot change these anymore without breaking a lot of management and tuning. In case of IPv6 only, we compile out everything but the sysctl node declarations. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC After: 5 days --- sys/conf/files | 2 +- sys/netinet/in_proto.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index b772c78c5f67..ee9d597ab947 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2653,7 +2653,7 @@ netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet netinet/in_mcast.c optional inet netinet/in_pcb.c optional inet | inet6 -netinet/in_proto.c optional inet \ +netinet/in_proto.c optional inet | inet6 \ compile-with "${NORMAL_C} -I$S/contrib/pf" netinet/in_rmx.c optional inet netinet/ip_divert.c optional inet ipdivert ipfirewall diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 110301a51006..a5907ec69338 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipx.h" #include "opt_mrouting.h" #include "opt_ipsec.h" +#include "opt_inet.h" #include "opt_inet6.h" #include "opt_pf.h" #include "opt_sctp.h" @@ -50,6 +51,13 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * While this file provides the domain and protocol switch tables for IPv4, it + * also provides the sysctl node declarations for net.inet.* often shared with + * IPv6 for common features or by upper layer protocols. In case of no IPv4 + * support compile out everything but these sysctl nodes. + */ +#ifdef INET #include #include #ifdef RADIX_MPATH @@ -372,6 +380,7 @@ struct domain inetdomain = { }; VNET_DOMAIN_SET(inet); +#endif /* INET */ SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0, "Internet Family");