summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
authorMaksim Yevmenkin <emax@FreeBSD.org>2012-05-30 20:02:39 +0000
committerMaksim Yevmenkin <emax@FreeBSD.org>2012-05-30 20:02:39 +0000
commitc784f9e5eb9248683981614c995a183bc6b15b12 (patch)
treedb8aeaff652cb0ea7bfe844cfa71b55f9bbec779 /sys/netinet6/in6.c
parent691df1a1f843e189ac92cd47ab8607b56a1a296b (diff)
downloadsrc-test-c784f9e5eb9248683981614c995a183bc6b15b12.tar.gz
src-test-c784f9e5eb9248683981614c995a183bc6b15b12.zip
Notes
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index ca491b8e4c37f..682d4d1560ec2 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2265,14 +2265,20 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
IF_ADDR_RUNLOCK(ifp);
return (struct in6_ifaddr *)ifa;
}
- IF_ADDR_RUNLOCK(ifp);
/* use the last-resort values, that are, deprecated addresses */
- if (dep[0])
+ if (dep[0]) {
+ ifa_ref((struct ifaddr *)dep[0]);
+ IF_ADDR_RUNLOCK(ifp);
return dep[0];
- if (dep[1])
+ }
+ if (dep[1]) {
+ ifa_ref((struct ifaddr *)dep[1]);
+ IF_ADDR_RUNLOCK(ifp);
return dep[1];
+ }
+ IF_ADDR_RUNLOCK(ifp);
return NULL;
}