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)