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
This commit is contained in:
Qing Li 2011-10-16 22:24:04 +00:00
parent ad4e66a63c
commit 14417253d8

View File

@ -1860,14 +1860,17 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
if (error != 0) if (error != 0)
return (error); return (error);
ia->ia_flags |= IFA_ROUTE; 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 * add a loopback route to self
*/ */
if (!(ia->ia_flags & IFA_RTSELF) if (!(ia->ia_flags & IFA_RTSELF) && V_nd6_useloopback) {
&& (V_nd6_useloopback
&& !(ifp->if_flags & IFF_LOOPBACK))) {
error = ifa_add_loopback_route((struct ifaddr *)ia, error = ifa_add_loopback_route((struct ifaddr *)ia,
(struct sockaddr *)&ia->ia_addr); (struct sockaddr *)&ia->ia_addr);
if (error == 0) if (error == 0)