summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/af_inet.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-05-31 14:40:21 +0000
committerbz <bz@FreeBSD.org>2011-05-31 14:40:21 +0000
commitb41f984f28787536530ac8d4af207059466e4656 (patch)
treec5b217151ec54cb77076312c57e051b61f3584bf /sbin/ifconfig/af_inet.c
parentf863f8506b376153bd82f6f80933a3faac1bd48c (diff)
downloadFreeBSD-src-b41f984f28787536530ac8d4af207059466e4656.zip
FreeBSD-src-b41f984f28787536530ac8d4af207059466e4656.tar.gz
Conditionally compile in the af_inet and af_inet6, af_nd6 modules.
If compiled in for dual-stack use, test with feature_present(3) to see if we should register the IPv4/IPv6 address family related options. In case there is no "inet" support we would love to go with the usage() and make the address family mandatory (as it is for anything but inet in theory). Unfortunately people are used to ifconfig IF up/down etc. as well, so use a fallback of "link". Adjust the man page to reflect these minor details. Improve error handling printing a warning in addition to the usage telling that we do not know the given address family in two places. Reviewed by: hrs, rwatson Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 2 weeks
Diffstat (limited to 'sbin/ifconfig/af_inet.c')
-rw-r--r--sbin/ifconfig/af_inet.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c
index 2e27114..6b4d735 100644
--- a/sbin/ifconfig/af_inet.c
+++ b/sbin/ifconfig/af_inet.c
@@ -200,5 +200,7 @@ static struct afswtch af_inet = {
static __constructor void
inet_ctor(void)
{
+ if (!feature_present("inet"))
+ return;
af_register(&af_inet);
}
OpenPOWER on IntegriCloud