summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-03-20 17:08:58 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-03-20 17:08:58 +0000
commitb89c943dd37242a822e0c26ee93d15268f549328 (patch)
treecf17527a50bab7815689209597ba85832131feee /sys/net/if.c
parent3def01ee2c9c8938b8b9e62b55a25a0cec6e1f88 (diff)
RFC 8981 allows the configuration of only temporary IPv6 addresses.
Make the interface come up when the IFXF_AUTOCONF6TEMP is set. OK kn
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 0da3720b838..e5c5e65129d 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.638 2021/03/18 15:58:58 claudio Exp $ */
+/* $OpenBSD: if.c,v 1.639 2021/03/20 17:08:57 florian Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1958,8 +1958,10 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
NET_LOCK();
#ifdef INET6
- if (ISSET(ifr->ifr_flags, IFXF_AUTOCONF6) &&
- !ISSET(ifp->if_xflags, IFXF_AUTOCONF6)) {
+ if ((ISSET(ifr->ifr_flags, IFXF_AUTOCONF6) ||
+ ISSET(ifr->ifr_flags, IFXF_AUTOCONF6TEMP)) &&
+ !ISSET(ifp->if_xflags, IFXF_AUTOCONF6) &&
+ !ISSET(ifp->if_xflags, IFXF_AUTOCONF6TEMP)) {
error = in6_ifattach(ifp);
if (error != 0) {
NET_UNLOCK();
@@ -2026,7 +2028,9 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
((!ISSET(oif_xflags, IFXF_AUTOCONF4) &&
ISSET(ifp->if_xflags, IFXF_AUTOCONF4)) ||
(!ISSET(oif_xflags, IFXF_AUTOCONF6) &&
- ISSET(ifp->if_xflags, IFXF_AUTOCONF6)))) {
+ ISSET(ifp->if_xflags, IFXF_AUTOCONF6)) ||
+ (!ISSET(oif_xflags, IFXF_AUTOCONF6TEMP) &&
+ ISSET(ifp->if_xflags, IFXF_AUTOCONF6TEMP)))) {
ifr->ifr_flags = ifp->if_flags | IFF_UP;
cmd = SIOCSIFFLAGS;
goto forceup;