diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-08-11 13:51:08 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-08-11 13:51:08 +0000 |
commit | 7e7d3426780bec256c97d71abfeb5759ac9106af (patch) | |
tree | 853de76263cd42711ef90d887148e17cf603fe73 /sys | |
parent | 735a86564db455cb94d31117b978c95b3cf5cb85 (diff) |
Use the RTF_LOCAL flag instead of abusing the RTF_LLINFO flag when
adding local route entries.
This hack made sense when we didn't have the RTF_LOCAL flag, but since
some months it is set on every local route.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 9 | ||||
-rw-r--r-- | sys/netinet/if_ether.c | 4 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 4 |
3 files changed, 6 insertions, 11 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index c3252652f79..3425b77f82c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.297 2014/07/12 18:44:22 tedu Exp $ */ +/* $OpenBSD: if.c,v 1.298 2014/08/11 13:51:07 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1001,12 +1001,7 @@ p2p_rtrequest(int req, struct rtentry *rt) switch (req) { case RTM_ADD: - /* - * XXX Here we abuse RTF_LLINFO to add a route to - * loopback. We do that to always have a route - * pointing to our address. - */ - if ((rt->rt_flags & RTF_LLINFO) == 0) + if ((rt->rt_flags & RTF_LOCAL) == 0) break; TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index b7d06942ddc..3d8d7f81c1b 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.132 2014/08/11 11:50:41 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.133 2014/08/11 13:51:07 mpi Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -180,7 +180,7 @@ arp_rtrequest(int req, struct rtentry *rt) satosin(rt_mask(rt))->sin_addr.s_addr != 0xffffffff) rt->rt_flags |= RTF_CLONING; if (rt->rt_flags & RTF_CLONING || - ((rt->rt_flags & RTF_LLINFO) && !la)) { + ((rt->rt_flags & (RTF_LLINFO | RTF_LOCAL)) && !la)) { /* * Case 1: This route should come from a route to iface. */ diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 044a6ea123d..d5c48f669b8 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.120 2014/07/12 18:44:23 tedu Exp $ */ +/* $OpenBSD: nd6.c,v 1.121 2014/08/11 13:51:07 mpi Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -1010,7 +1010,7 @@ nd6_rtrequest(int req, struct rtentry *rt) * rt->rt_flags |= RTF_CLONING; */ if ((rt->rt_flags & RTF_CLONING) || - ((rt->rt_flags & RTF_LLINFO) && !ln)) { + ((rt->rt_flags & (RTF_LLINFO | RTF_LOCAL)) && !ln)) { /* * Case 1: This route should come from a route to * interface (RTF_CLONING case) or the route should be |