aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 48fa8dd2efc6..057c0ee91e02 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1921,10 +1921,8 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
besta = (struct in6_ifaddr *)ifa;
}
}
- if (besta) {
- ifa_ref(&besta->ia_ifa);
+ if (besta)
return (besta);
- }
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
@@ -1941,20 +1939,14 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
continue;
}
- if (ifa != NULL)
- ifa_ref(ifa);
return (struct in6_ifaddr *)ifa;
}
/* use the last-resort values, that are, deprecated addresses */
- if (dep[0]) {
- ifa_ref((struct ifaddr *)dep[0]);
+ if (dep[0])
return dep[0];
- }
- if (dep[1]) {
- ifa_ref((struct ifaddr *)dep[1]);
+ if (dep[1])
return dep[1];
- }
return NULL;
}