From: mpi Date: Mon, 11 Aug 2014 13:51:07 +0000 (+0000) Subject: Use the RTF_LOCAL flag instead of abusing the RTF_LLINFO flag when X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5f3e87fca3cd593108eb7076e438d99f3a0e7f17;p=openbsd 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. --- 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