From c937a45692528ce9b57f0a25d70ace28f368abee Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Mar 2021 17:08:57 +0000 Subject: [PATCH] RFC 8981 allows the configuration of only temporary IPv6 addresses. Make the interface come up when the IFXF_AUTOCONF6TEMP is set. OK kn --- sys/net/if.c | 12 ++++++++---- 1 file 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; -- 2.20.1