summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/af_inet6.c
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2009-09-12 22:08:20 +0000
committerhrs <hrs@FreeBSD.org>2009-09-12 22:08:20 +0000
commit2eb62239d7432351eb544690c4ea2fc648ae2abc (patch)
treea8b68cd78a93144234b4c47ac70911fd744e48ff /sbin/ifconfig/af_inet6.c
parent02e6d1c7f95b09e7d57ae3d261a65a3ea25aa637 (diff)
downloadFreeBSD-src-2eb62239d7432351eb544690c4ea2fc648ae2abc.zip
FreeBSD-src-2eb62239d7432351eb544690c4ea2fc648ae2abc.tar.gz
Improve flexibility of receiving Router Advertisement and
automatic link-local address configuration: - Convert a sysctl net.inet6.ip6.accept_rtadv to one for the default value of a per-IF flag ND6_IFF_ACCEPT_RTADV, not a global knob. The default value of the sysctl is 0. - Add a new per-IF flag ND6_IFF_AUTO_LINKLOCAL and convert a sysctl net.inet6.ip6.auto_linklocal to one for its default value. The default value of the sysctl is 1. - Make ND6_IFF_IFDISABLED more robust. It can be used to disable IPv6 functionality of an interface now. - Receiving RA is allowed if ip6_forwarding==0 *and* ND6_IFF_ACCEPT_RTADV is set on that interface. The former condition will be revisited later to support a "host + router" box like IPv6 CPE router. The current behavior is compatible with the older releases of FreeBSD. - The ifconfig(8) now supports these ND6 flags as well as "nud", "prefer_source", and "disabled" in ndp(8). The ndp(8) now supports "auto_linklocal". Discussed with: bz and jinmei Reviewed by: bz MFC after: 3 days
Diffstat (limited to 'sbin/ifconfig/af_inet6.c')
-rw-r--r--sbin/ifconfig/af_inet6.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index 13789dc..8fc143a 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -67,6 +67,9 @@ static int prefix(void *, int);
static char *sec2str(time_t);
static int explicit_prefix = 0;
+extern void setnd6flags(const char *, int, int, const struct afswtch *);
+extern void setnd6defif(const char *, int, int, const struct afswtch *);
+
static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/
static void
@@ -493,6 +496,18 @@ static struct cmd inet6_cmds[] = {
DEF_CMD("-deprecated", -IN6_IFF_DEPRECATED, setip6flags),
DEF_CMD("autoconf", IN6_IFF_AUTOCONF, setip6flags),
DEF_CMD("-autoconf", -IN6_IFF_AUTOCONF, setip6flags),
+ DEF_CMD("accept_rtadv", ND6_IFF_ACCEPT_RTADV, setnd6flags),
+ DEF_CMD("-accept_rtadv",-ND6_IFF_ACCEPT_RTADV, setnd6flags),
+ DEF_CMD("defaultif", 1, setnd6defif),
+ DEF_CMD("-defaultif", -1, setnd6defif),
+ DEF_CMD("ifdisabled", ND6_IFF_IFDISABLED, setnd6flags),
+ DEF_CMD("-ifdisabled", -ND6_IFF_IFDISABLED, setnd6flags),
+ DEF_CMD("nud", ND6_IFF_PERFORMNUD, setnd6flags),
+ DEF_CMD("-nud", -ND6_IFF_PERFORMNUD, setnd6flags),
+ DEF_CMD("prefer_source",ND6_IFF_PREFER_SOURCE, setnd6flags),
+ DEF_CMD("-prefer_source",-ND6_IFF_PREFER_SOURCE,setnd6flags),
+ DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
+ DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
DEF_CMD_ARG("pltime", setip6pltime),
DEF_CMD_ARG("vltime", setip6vltime),
DEF_CMD("eui64", 0, setip6eui64),
OpenPOWER on IntegriCloud