From 4fd26a87dc702b4af14187dd0bea5282657c4b6d Mon Sep 17 00:00:00 2001 From: qingli Date: Sun, 16 Oct 2011 22:24:04 +0000 Subject: The code change made in r226040 was incomplete and resulted in routes such as fe80::1%lo0 no being installed. This patch completes the original intended fix. Reviewed by: hrs, bz MFC after: 3 days --- sys/netinet6/in6.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/netinet6/in6.c') diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 6e42eae..1e6cb94 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1860,14 +1860,17 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia, if (error != 0) return (error); ia->ia_flags |= IFA_ROUTE; + /* + * Handle the case for ::1 . + */ + if (ifp->if_flags & IFF_LOOPBACK) + ia->ia_flags |= IFA_RTSELF; } /* * add a loopback route to self */ - if (!(ia->ia_flags & IFA_RTSELF) - && (V_nd6_useloopback - && !(ifp->if_flags & IFF_LOOPBACK))) { + if (!(ia->ia_flags & IFA_RTSELF) && V_nd6_useloopback) { error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); if (error == 0) -- cgit v1.1