aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorQing Li <qingli@FreeBSD.org>2010-02-27 07:12:25 +0000
committerQing Li <qingli@FreeBSD.org>2010-02-27 07:12:25 +0000
commitc1752bcd65f84d48699c2f95f7a4de4fdfd5d167 (patch)
tree8d9092c3bb0f69badfd4192f4e88c3c4a30b6b20 /sys/netinet6
parent443e752d97bd51b3e124436734ffba7be0eb0682 (diff)
Notes
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/nd6.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index d90520eded14..a32539b8972b 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -764,22 +764,25 @@ regen_tmpaddr(struct in6_ifaddr *ia6)
*/
if (!IFA6_IS_DEPRECATED(it6))
public_ifa6 = it6;
+
+ if (public_ifa6 != NULL)
+ ifa_ref(&public_ifa6->ia_ifa);
}
+ IF_ADDR_UNLOCK(ifp);
if (public_ifa6 != NULL) {
int e;
if ((e = in6_tmpifadd(public_ifa6, 0, 0)) != 0) {
- IF_ADDR_UNLOCK(ifp);
+ ifa_free(&public_ifa6->ia_ifa);
log(LOG_NOTICE, "regen_tmpaddr: failed to create a new"
" tmp addr,errno=%d\n", e);
return (-1);
}
- IF_ADDR_UNLOCK(ifp);
+ ifa_free(&public_ifa6->ia_ifa);
return (0);
}
- IF_ADDR_UNLOCK(ifp);
return (-1);
}