1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

When we return deprecated addresses, we need to reference them.

Reviewed by:	bz, scottl
MFC after:	3 days
This commit is contained in:
Maksim Yevmenkin 2012-05-30 20:02:39 +00:00
parent 691df1a1f8
commit c784f9e5eb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236327

View File

@ -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;
}