version 1.438, 2018/10/30 05:27:51 |
version 1.439, 2018/10/30 05:29:21 |
|
|
ifaref(struct ifaddr *ifa) |
ifaref(struct ifaddr *ifa) |
{ |
{ |
|
|
ifa->ifa_refcnt++; |
atomic_inc_uint(&ifa->ifa_refcnt); |
} |
} |
|
|
void |
void |
Line 1793 ifafree(struct ifaddr *ifa) |
|
Line 1793 ifafree(struct ifaddr *ifa) |
|
KASSERT(ifa != NULL); |
KASSERT(ifa != NULL); |
KASSERT(ifa->ifa_refcnt > 0); |
KASSERT(ifa->ifa_refcnt > 0); |
|
|
if (--ifa->ifa_refcnt == 0) { |
if (atomic_dec_uint_nv(&ifa->ifa_refcnt) == 0) { |
free(ifa, M_IFADDR); |
free(ifa, M_IFADDR); |
} |
} |
} |
} |