diff options
| author | Qing Li <qingli@FreeBSD.org> | 2010-03-08 21:30:12 +0000 |
|---|---|---|
| committer | Qing Li <qingli@FreeBSD.org> | 2010-03-08 21:30:12 +0000 |
| commit | 44520d2930e35a19fdaa0db3e606b3e987618266 (patch) | |
| tree | d68341678a352d3ed2750f7ce77dc6e0c8d296be /sys | |
| parent | ca493fb650bbe2e27ffc06c0e93ab0e1012dda67 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/netinet6/nd6.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 50c273d87a3b..4c941da2c770 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -759,22 +759,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); } |
