summaryrefslogtreecommitdiffstats
path: root/sys/net/route.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-05-31 07:42:39 +0000
committermpi <mpi@openbsd.org>2016-05-31 07:42:39 +0000
commite9eb3ed1962ed18aee142530722cd71d8372c7e4 (patch)
tree6d817d54323818e29da3b6032635fa1a169fcdd3 /sys/net/route.c
parentDo not call nd6_output() without route entry argument. (diff)
downloadwireguard-openbsd-e9eb3ed1962ed18aee142530722cd71d8372c7e4.tar.xz
wireguard-openbsd-e9eb3ed1962ed18aee142530722cd71d8372c7e4.zip
Flush dynamic route entries attached to an interface when its link state
becomes DOWN. This follows the same reasonning as for L2 (cloned) entries. Hopefully enough to fix tedu@'s stale RTF_DYNAMIC routes when switching WiFi network during suspend/resume. ok sthen@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r--sys/net/route.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 28a00a8315c..17f6c444974 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.301 2016/05/31 07:29:34 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.302 2016/05/31 07:42:39 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -1783,11 +1783,11 @@ rt_if_linkstate_change(struct rtentry *rt, void *arg, u_int id)
} else {
if (rt->rt_flags & RTF_UP) {
/*
- * Remove cloned routes (mainly arp) to
- * down interfaces so we have a chance to
- * clone a new route from a better source.
+ * Remove redirected and cloned routes (mainly ARP)
+ * from down interfaces so we have a chance to get
+ * new routes from a better source.
*/
- if (rt->rt_flags & RTF_CLONED) {
+ if (ISSET(rt->rt_flags, RTF_CLONED|RTF_DYNAMIC)) {
rtdeletemsg(rt, ifp, id);
return (EAGAIN);
}