diff options
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 7dcc488e362..b3ba114f908 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.230 2010/04/03 03:13:01 deraadt Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.231 2010/04/06 14:12:10 stsp Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -338,6 +338,8 @@ const struct cmd { { "pltime", NEXTARG, 0, setia6pltime }, { "vltime", NEXTARG, 0, setia6vltime }, { "eui64", 0, 0, setia6eui64 }, + { "autoconfprivacy", IFXF_INET6_PRIVACY, 0, setifxflags }, + { "-autoconfprivacy", -IFXF_INET6_PRIVACY, 0, setifxflags }, #endif /*INET6*/ #ifndef SMALL { "rtlabel", NEXTARG, 0, setifrtlabel }, @@ -1189,6 +1191,12 @@ setifxflags(const char *vname, int value) { struct ifreq my_ifr; + if ((value == IFXF_INET6_PRIVACY || value == -IFXF_INET6_PRIVACY) + && afp->af_af != AF_INET6) { + errx(1, "autoconfprivacy needs AF inet6, current AF is `%s'", + afp->af_name); + } + bcopy((char *)&ifr, (char *)&my_ifr, sizeof(struct ifreq)); if (ioctl(s, SIOCGIFXFLAGS, (caddr_t)&my_ifr) < 0) @@ -2981,6 +2989,8 @@ in6_alias(struct in6_ifreq *creq) printf(" deprecated"); if (ifr6.ifr_ifru.ifru_flags6 & IN6_IFF_AUTOCONF) printf(" autoconf"); + if (ifr6.ifr_ifru.ifru_flags6 & IN6_IFF_PRIVACY) + printf(" autoconfprivacy"); } if (scopeid) |