diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-21 19:30:33 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-21 19:30:33 +0000 |
commit | 1f7e54e8c51edb13935d195e0c1f2ec68c672794 (patch) | |
tree | 2cfffa4418c1fa90f1e9d094aa882742d0ababb9 /sys/net/rtsock.c | |
parent | 2fc79768f33d575d200ae1482dc23207f9d93703 (diff) | |
download | FreeBSD-src-1f7e54e8c51edb13935d195e0c1f2ec68c672794.zip FreeBSD-src-1f7e54e8c51edb13935d195e0c1f2ec68c672794.tar.gz |
Clean up common ifaddr management:
- Unify reference count and lock initialization in a single function,
ifa_init().
- Move tear-down from a macro (IFAFREE) to a function ifa_free().
- Move reference count bump from a macro (IFAREF) to a function ifa_ref().
- Instead of using a u_int protected by a mutex to refcount(9) for
reference count management.
The ifa_mtx is now used for exactly one ioctl, and possibly should be
removed.
MFC after: 3 weeks
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r-- | sys/net/rtsock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 56bb3a7..ab38557 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -694,7 +694,7 @@ route_output(struct mbuf *m, struct socket *so) rt->rt_ifa->ifa_rtrequest != NULL) { rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, &info); - IFAFREE(rt->rt_ifa); + ifa_free(rt->rt_ifa); } if (info.rti_info[RTAX_GATEWAY] != NULL) { RT_UNLOCK(rt); @@ -712,7 +712,7 @@ route_output(struct mbuf *m, struct socket *so) } if (info.rti_ifa != NULL && info.rti_ifa != rt->rt_ifa) { - IFAREF(info.rti_ifa); + ifa_ref(info.rti_ifa); rt->rt_ifa = info.rti_ifa; rt->rt_ifp = info.rti_ifp; } |