summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-08-04 21:32:27 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-08-04 21:32:27 +0000
commit2d6ab3b9a6961570a3ebc23b79fa932256c148ed (patch)
treec98d1fea20e1de666e8d71c3b8d3d5fbf2c4b29e
parentc27ebe64d0965b7cc77b158d1c2725583f9faf97 (diff)
When we disable INET6 on an interface that also removes the autoconf6
flag. Notify userland about this via the route socket, otherwise slaacd gets confused about the state the interface is in. OK on a previous version sthen input & OK bluhm
-rw-r--r--sys/net/if.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index ed95b15b8c9..4fd055f2854 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.507 2017/08/01 20:57:10 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.508 2017/08/04 21:32:26 florian Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1828,7 +1828,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
struct if_afreq *ifar;
char ifdescrbuf[IFDESCRSIZE];
char ifrtlabelbuf[RTLABEL_LEN];
- int s, error = 0;
+ int s, error = 0, oif_xflags;
size_t bytesdone;
short oif_flags;
const char *label;
@@ -1865,23 +1865,28 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
ifar = (struct if_afreq *)data;
if ((ifp = ifunit(ifar->ifar_name)) == NULL)
return (ENXIO);
+ oif_flags = ifp->if_flags;
+ oif_xflags = ifp->if_xflags;
switch (ifar->ifar_af) {
case AF_INET:
/* attach is a noop for AF_INET */
if (cmd == SIOCIFAFDETACH)
in_ifdetach(ifp);
- return (0);
+ break;
#ifdef INET6
case AF_INET6:
if (cmd == SIOCIFAFATTACH)
error = in6_ifattach(ifp);
else
in6_ifdetach(ifp);
- return (error);
+ break;
#endif /* INET6 */
default:
return (EAFNOSUPPORT);
}
+ if (oif_flags != ifp->if_flags || oif_xflags != ifp->if_xflags)
+ rtm_ifchg(ifp);
+ return (error);
}
ifp = ifunit(ifr->ifr_name);