diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-07-19 10:26:42 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-07-19 10:26:42 +0000 |
commit | 1590d1aabf8c0e762d82ec281f3700c834a6013e (patch) | |
tree | 0873e65b1d55a6e1f5f9f9023547c6a1fb95602c /sys/net/route.c | |
parent | a16a9977ebfb480cf9cbf9f6acac83506d585888 (diff) |
Return EAGAIN for every deleted route when detaching an interface.
Previously the code was "too clever" and returned EAGAIN only for
cloning route assuming that other deletion did not modify the tree.
Analysed by and ok dlg@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r-- | sys/net/route.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 80cbd3aa34a..f9fa397009d 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.311 2016/07/11 13:06:31 bluhm Exp $ */ +/* $OpenBSD: route.c,v 1.312 2016/07/19 10:26:41 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1721,22 +1721,14 @@ rt_if_remove(struct ifnet *ifp) } } -/* - * Note that deleting a RTF_CLONING route can trigger the - * deletion of more entries, so we need to cancel the walk - * and return EAGAIN. The caller should restart the walk - * as long as EAGAIN is returned. - */ int rt_if_remove_rtdelete(struct rtentry *rt, void *vifp, u_int id) { struct ifnet *ifp = vifp; if (rt->rt_ifidx == ifp->if_index) { - int cloning = (rt->rt_flags & RTF_CLONING); - - if (rtdeletemsg(rt, ifp, id) == 0 && cloning) - return (EAGAIN); + rtdeletemsg(rt, ifp, id); + return (EAGAIN); } return (0); |