summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2013-10-21 08:44:14 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2013-10-21 08:44:14 +0000
commit810ae1b744042fbfe474c2d431fac6f7ec5e7693 (patch)
treea5fe96798220ebb2ce30ffba2b526e7af0f3202a /sys/net
parent71f6cd32c67cb5bd9cc54e8a8a308c895a4d7eaf (diff)
Enable IPv6 routing domain support
Started by claudio@ for IPv4, lots of heavy work by sperreault@ My part started at s2k11, continued at n2k12, g2k12, c2k12 and n2k13. Lots of help and hints from claudio and bluhm OK claudio@, bluhm@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 23014af5566..b773e41cb86 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.272 2013/10/20 13:21:56 claudio Exp $ */
+/* $OpenBSD: if.c,v 1.273 2013/10/21 08:44:13 phessler Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1213,6 +1213,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
size_t bytesdone;
short oif_flags;
const char *label;
+ short up = 0;
switch (cmd) {
@@ -1495,6 +1496,16 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
/* XXX hell this is ugly */
if (ifr->ifr_rdomainid != ifp->if_rdomain) {
s = splnet();
+ if (ifp->if_flags & IFF_UP)
+ up = 1;
+ /*
+ * We are tearing down the world.
+ * Take down the IF so:
+ * 1. everything that cares gets a message
+ * 2. the automagic IPv6 bits are recreated
+ */
+ if (up)
+ if_down(ifp);
rt_if_remove(ifp);
#ifdef INET
rti_delete(ifp);
@@ -1504,7 +1515,6 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
#endif
#ifdef INET6
in6_ifdetach(ifp);
- ifp->if_xflags |= IFXF_NOINET6;
#endif
#ifdef INET
in_ifdetach(ifp);
@@ -1652,6 +1662,12 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
}
#endif
}
+ /* If we took down the IF, bring it back */
+ if (up) {
+ s = splnet();
+ if_up(ifp);
+ splx(s);
+ }
return (error);
}