diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-09-04 15:45:43 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-09-04 15:45:43 +0000 |
commit | 3f38cff19d94d48f8b6f0c2e0b6cb042fd572658 (patch) | |
tree | 5cb8dae18afa5a926a5baada9a0568963717fb52 /sys | |
parent | 0958d5c45bb8325f5bff2865e04bf747afc67107 (diff) |
Do not assume that an interface index of a route is still valid in
rtrequest_delete(). The inpcb has a cache of the route that still
exists when the interface has been detached.
kassert triggered from tcp timeout by awolk@; OK mpi@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/route.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index ed828c835ad..3d91064650a 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.324 2016/09/04 10:32:01 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.325 2016/09/04 15:45:42 bluhm Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -904,9 +904,10 @@ rtrequest_delete(struct rt_addrinfo *info, u_int8_t prio, struct ifnet *ifp, if (ifp == NULL) { ifp = if_get(rt->rt_ifidx); - KASSERT(ifp != NULL); - ifp->if_rtrequest(ifp, RTM_DELETE, rt); - if_put(ifp); + if (ifp != NULL) { + ifp->if_rtrequest(ifp, RTM_DELETE, rt); + if_put(ifp); + } } else { KASSERT(ifp->if_index == rt->rt_ifidx); ifp->if_rtrequest(ifp, RTM_DELETE, rt); |