summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-09-08 09:11:44 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-09-08 09:11:44 +0000
commitb573cd1da2cdb12b99b5439b61a955624527fe99 (patch)
tree0b288924841bd2e59aeba71bb4838563756ce47b /sys
parent5d29afd765ce6aa5880a78e28dfe7c210821592e (diff)
Call bfd_rtfree() when the route entry has been removed from the table,
not before. ok claudio@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/route.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index f0f408faed2..54c72308521 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.326 2016/09/07 09:19:38 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.327 2016/09/08 09:11:43 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -881,11 +881,6 @@ rtrequest_delete(struct rt_addrinfo *info, u_int8_t prio, struct ifnet *ifp,
}
#endif
-#ifdef BFD
- if (ISSET(rt->rt_flags, RTF_BFD))
- bfd_rtfree(rt);
-#endif
-
error = rtable_delete(tableid, info->rti_info[RTAX_DST],
info->rti_info[RTAX_NETMASK], rt);
if (error != 0) {
@@ -893,6 +888,11 @@ rtrequest_delete(struct rt_addrinfo *info, u_int8_t prio, struct ifnet *ifp,
return (ESRCH);
}
+#ifdef BFD
+ if (ISSET(rt->rt_flags, RTF_BFD))
+ bfd_rtfree(rt);
+#endif
+
/* Release next hop cache before flushing cloned entries. */
rt_putgwroute(rt);