summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_rmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/in_rmx.c')
-rw-r--r--sys/netinet/in_rmx.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index 52d062d..51a5846 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -357,14 +357,12 @@ in_inithead(void **head, int off)
/*
- * This zaps old routes when the interface goes down.
- * Currently it doesn't delete static routes; there are
- * arguments one could make for both behaviors. For the moment,
- * we will adopt the Principle of Least Surprise and leave them
- * alone (with the knowledge that this will not be enough for some
- * people). The ones we really want to get rid of are things like ARP
- * entries, since the user might down the interface, walk over to a completely
- * different network, and plug back in.
+ * This zaps old routes (including ARP entries) when the interface
+ * address is deleted. Previously it didn't delete static routes,
+ * and this caused some weird things to happen. In particular, if
+ * you changed the address on an interface, and the default route
+ * was using this interface and address, outgoing datagrams still
+ * used the old address.
*/
struct in_ifadown_arg {
struct radix_node_head *rnh;
@@ -378,7 +376,7 @@ in_ifadownkill(struct radix_node *rn, void *xap)
struct rtentry *rt = (struct rtentry *)rn;
int err;
- if (rt->rt_ifa == ap->ifa && !(rt->rt_flags & RTF_STATIC)) {
+ if (rt->rt_ifa == ap->ifa) {
/*
* We need to disable the automatic prune that happens
* in this case in rtrequest() because it will blow
@@ -387,7 +385,7 @@ in_ifadownkill(struct radix_node *rn, void *xap)
* the routes that rtrequest() would have in any case,
* so that behavior is not needed there.
*/
- rt->rt_flags &= ~RTF_PRCLONING;
+ rt->rt_flags &= ~(RTF_CLONING | RTF_PRCLONING);
err = rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt),
rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0);
if (err) {
OpenPOWER on IntegriCloud