summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-05-31 07:42:40 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-05-31 07:42:40 +0000
commit265a0b18662e733af86ed715c5a74ab12fbdeedb (patch)
tree25d935ab999fbdc17c8a029d37ba8f3139bac57a /sys/net
parent1bae341b33619352a192a1448ff998efcf81dbd5 (diff)
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')
-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);
}