From 14417253d8c696be0663cd857d2da0cf7c19bdc3 Mon Sep 17 00:00:00 2001 From: Qing Li Date: Sun, 16 Oct 2011 22:24:04 +0000 Subject: [PATCH] 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(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 6e42eae51c5..1e6cb948116 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)