summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2021-03-11 16:48:47 +0000
committerflorian <florian@openbsd.org>2021-03-11 16:48:47 +0000
commitaa770b8801c9829c5212c45642dcb3d04f738a3d (patch)
tree4a8a7eb669f17677c238ed1f60ef2f2951c715c7
parentIf the AUTOCONF4 or AUTOCONF6 flags get enabled, force the interface up. (diff)
downloadwireguard-openbsd-aa770b8801c9829c5212c45642dcb3d04f738a3d.tar.xz
wireguard-openbsd-aa770b8801c9829c5212c45642dcb3d04f738a3d.zip
There is no need to try to attach IPv6 to an interface when the
AUTOCONF6 flag is already set. This is likely a leftover from when we sent router solicitations from the kernel. This was a way to trigger sending a solicitation from userland. OK kn
-rw-r--r--sys/net/if.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 912ce495661..3e40c59d213 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.635 2021/03/11 15:56:27 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.636 2021/03/11 16:48:47 florian Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1958,7 +1958,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
NET_LOCK();
#ifdef INET6
- if (ISSET(ifr->ifr_flags, IFXF_AUTOCONF6)) {
+ if (ISSET(ifr->ifr_flags, IFXF_AUTOCONF6) &&
+ !ISSET(ifp->if_xflags, IFXF_AUTOCONF6)) {
error = in6_ifattach(ifp);
if (error != 0) {
NET_UNLOCK();