diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-09-03 10:05:20 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-09-03 10:05:20 +0000 |
commit | 088f36a608b508ee970fade594785fcdda7d2a27 (patch) | |
tree | 7b19d1d95ac4ca48ee3034f4050ec2c31fd1e9cd /sys/net/if.c | |
parent | 5b0b0056e7b5fdabf0a65b08b6541ec7a303a003 (diff) |
Remove routes added by the kernel before userland ones.
This is a correctness change that will allow us to check that
nothing happend with kernel added routes.
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 673805db9cc..8f734148156 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.439 2016/09/03 09:55:44 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.440 2016/09/03 10:05:19 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -942,7 +942,6 @@ if_detach(struct ifnet *ifp) #if NBPFILTER > 0 bpfdetach(ifp); #endif - rt_if_remove(ifp); rti_delete(ifp); #if NETHER > 0 && defined(NFSCLIENT) if (ifp->if_index == revarp_ifidx) @@ -955,6 +954,7 @@ if_detach(struct ifnet *ifp) #ifdef INET6 in6_ifdetach(ifp); #endif + rt_if_remove(ifp); #if NPF > 0 pfi_detach_ifnet(ifp); #endif @@ -1943,15 +1943,15 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) */ if (up) if_down(ifp); - rt_if_remove(ifp); rti_delete(ifp); #ifdef MROUTING vif_delete(ifp); #endif + in_ifdetach(ifp); #ifdef INET6 in6_ifdetach(ifp); #endif - in_ifdetach(ifp); + rt_if_remove(ifp); splx(s); } |