Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys If, for whatever reason, a local interface route is remo...
details: https://anonhg.NetBSD.org/src/rev/6fdf59af05ba
branches: trunk
changeset: 340537:6fdf59af05ba
user: roy <roy%NetBSD.org@localhost>
date: Fri Sep 11 10:33:32 2015 +0000
description:
If, for whatever reason, a local interface route is removed and then
re-added, mark it as a local route.
While here, if changing the route to go via the loopback interface
remove any inherited MTU value.
diffstat:
sys/netinet/if_arp.c | 9 ++++++---
sys/netinet6/nd6.c | 6 ++++--
2 files changed, 10 insertions(+), 5 deletions(-)
diffs (60 lines):
diff -r 4bdfb9eb424f -r 6fdf59af05ba sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c Fri Sep 11 09:25:52 2015 +0000
+++ b/sys/netinet/if_arp.c Fri Sep 11 10:33:32 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_arp.c,v 1.180 2015/09/09 01:24:01 ozaki-r Exp $ */
+/* $NetBSD: if_arp.c,v 1.181 2015/09/11 10:33:32 roy Exp $ */
/*-
* Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.180 2015/09/09 01:24:01 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.181 2015/09/11 10:33:32 roy Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -641,8 +641,11 @@
panic("%s(%s): sockaddr_dl_init cannot fail",
__func__, ifp->if_xname);
}
- if (useloopback)
+ if (useloopback) {
ifp = rt->rt_ifp = lo0ifp;
+ rt->rt_rmx.rmx_mtu = 0;
+ }
+ rt->rt_flags |= RTF_LOCAL;
/*
* make sure to set rt->rt_ifa to the interface
* address we are using, otherwise we will have trouble
diff -r 4bdfb9eb424f -r 6fdf59af05ba sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c Fri Sep 11 09:25:52 2015 +0000
+++ b/sys/netinet6/nd6.c Fri Sep 11 10:33:32 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nd6.c,v 1.176 2015/09/04 05:33:23 ozaki-r Exp $ */
+/* $NetBSD: nd6.c,v 1.177 2015/09/11 10:33:32 roy Exp $ */
/* $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.176 2015/09/04 05:33:23 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.177 2015/09/11 10:33:32 roy Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -1478,8 +1478,10 @@
*/
if (ifa != rt->rt_ifa)
rt_replace_ifa(rt, ifa);
+ rt->rt_rmx.rmx_mtu = 0;
rt->rt_flags &= ~RTF_CLONED;
}
+ rt->rt_flags |= RTF_LOCAL;
} else if (rt->rt_flags & RTF_ANNOUNCE) {
nd6_llinfo_settimer(ln, -1);
ln->ln_state = ND6_LLINFO_REACHABLE;
Home |
Main Index |
Thread Index |
Old Index