diff options
author | qingli <qingli@FreeBSD.org> | 2011-10-16 22:24:04 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2011-10-16 22:24:04 +0000 |
commit | 4fd26a87dc702b4af14187dd0bea5282657c4b6d (patch) | |
tree | d6e7d3a3a5cea85726ecbdb74963e04b1577adad /sys/netinet6/in6.c | |
parent | b526ecc3e052700869051c3ee381b15035b9529b (diff) | |
download | FreeBSD-src-4fd26a87dc702b4af14187dd0bea5282657c4b6d.zip FreeBSD-src-4fd26a87dc702b4af14187dd0bea5282657c4b6d.tar.gz |
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
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 9 |
1 files changed, 6 insertions, 3 deletions
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) |