summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
authorQing Li <qingli@FreeBSD.org>2009-12-30 21:35:34 +0000
committerQing Li <qingli@FreeBSD.org>2009-12-30 21:35:34 +0000
commitc7ab66020fb183062ded58a617a6b4979fdd9e63 (patch)
tree8e2dcb46479d9e8deaedba15ff39e4bf06edf8c9 /sys/netinet6/in6.c
parent767dff0ac99b37f758d511ba10d4e538750f546a (diff)
downloadsrc-test-c7ab66020fb183062ded58a617a6b4979fdd9e63.tar.gz
src-test-c7ab66020fb183062ded58a617a6b4979fdd9e63.zip
Notes
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 7254c4d0eb08b..c839efdc8df57 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1200,8 +1200,12 @@ in6_purgeaddr(struct ifaddr *ifa)
* The check for the current setting of "nd6_useloopback"
* is not needed.
*/
- error = ifa_del_loopback_route((struct ifaddr *)ia,
- (struct sockaddr *)&ia->ia_addr);
+ if (ia->ia_flags & IFA_RTSELF) {
+ error = ifa_del_loopback_route((struct ifaddr *)ia,
+ (struct sockaddr *)&ia->ia_addr);
+ if (error == 0)
+ ia->ia_flags &= ~IFA_RTSELF;
+ }
/* stop DAD processing */
nd6_dad_stop(ifa);
@@ -1762,6 +1766,8 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
|| (ifp->if_flags & IFF_LOOPBACK))) {
error = ifa_add_loopback_route((struct ifaddr *)ia,
(struct sockaddr *)&ia->ia_addr);
+ if (error == 0)
+ ia->ia_flags |= IFA_RTSELF;
}
/* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */
@@ -2347,7 +2353,9 @@ in6_lltable_prefix_free(struct lltable *llt,
}
static int
-in6_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr)
+in6_lltable_rtcheck(struct ifnet *ifp,
+ u_int flags,
+ const struct sockaddr *l3addr)
{
struct rtentry *rt;
char ip6buf[INET6_ADDRSTRLEN];
@@ -2415,7 +2423,7 @@ in6_lltable_lookup(struct lltable *llt, u_int flags,
* verify this.
*/
if (!(flags & LLE_IFADDR) &&
- in6_lltable_rtcheck(ifp, l3addr) != 0)
+ in6_lltable_rtcheck(ifp, flags, l3addr) != 0)
return NULL;
lle = in6_lltable_new(l3addr, flags);