summaryrefslogtreecommitdiffstats
path: root/sys/net/rtsock.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-01-05 19:00:36 +0000
committerjhb <jhb@FreeBSD.org>2012-01-05 19:00:36 +0000
commit4ef366671a65893ccd19a3fc76c415ab0d9a25f2 (patch)
treee3a128009150d5297d5066b93f051a1a5e2375a5 /sys/net/rtsock.c
parent219e62f17ed5852c0d61721758ef94a0587939f4 (diff)
downloadFreeBSD-src-4ef366671a65893ccd19a3fc76c415ab0d9a25f2.zip
FreeBSD-src-4ef366671a65893ccd19a3fc76c415ab0d9a25f2.tar.gz
Convert all users of IF_ADDR_LOCK to use new locking macros that specify
either a read lock or write lock. Reviewed by: bz MFC after: 2 weeks
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r--sys/net/rtsock.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 3520824..acc4817 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -456,7 +456,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
* Try to find an address on the given outgoing interface
* that belongs to the jail.
*/
- IF_ADDR_LOCK(ifp);
+ IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa;
sa = ifa->ifa_addr;
@@ -468,7 +468,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
break;
}
}
- IF_ADDR_UNLOCK(ifp);
+ IF_ADDR_RUNLOCK(ifp);
if (!found) {
/*
* As a last resort return the 'default' jail address.
@@ -498,7 +498,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
* Try to find an address on the given outgoing interface
* that belongs to the jail.
*/
- IF_ADDR_LOCK(ifp);
+ IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa;
sa = ifa->ifa_addr;
@@ -511,7 +511,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
break;
}
}
- IF_ADDR_UNLOCK(ifp);
+ IF_ADDR_RUNLOCK(ifp);
if (!found) {
/*
* As a last resort return the 'default' jail address.
@@ -1547,7 +1547,7 @@ sysctl_iflist(int af, struct walkarg *w)
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
if (w->w_arg && w->w_arg != ifp->if_index)
continue;
- IF_ADDR_LOCK(ifp);
+ IF_ADDR_RLOCK(ifp);
ifa = ifp->if_addr;
info.rti_info[RTAX_IFP] = ifa->ifa_addr;
len = rt_msg2(RTM_IFINFO, &info, NULL, w);
@@ -1614,13 +1614,13 @@ sysctl_iflist(int af, struct walkarg *w)
goto done;
}
}
- IF_ADDR_UNLOCK(ifp);
+ IF_ADDR_RUNLOCK(ifp);
info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] =
info.rti_info[RTAX_BRD] = NULL;
}
done:
if (ifp != NULL)
- IF_ADDR_UNLOCK(ifp);
+ IF_ADDR_RUNLOCK(ifp);
IFNET_RUNLOCK();
return (error);
}
@@ -1641,7 +1641,7 @@ sysctl_ifmalist(int af, struct walkarg *w)
continue;
ifa = ifp->if_addr;
info.rti_info[RTAX_IFP] = ifa ? ifa->ifa_addr : NULL;
- IF_ADDR_LOCK(ifp);
+ IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (af && af != ifma->ifma_addr->sa_family)
continue;
@@ -1662,12 +1662,12 @@ sysctl_ifmalist(int af, struct walkarg *w)
ifmam->ifmam_addrs = info.rti_addrs;
error = SYSCTL_OUT(w->w_req, w->w_tmem, len);
if (error) {
- IF_ADDR_UNLOCK(ifp);
+ IF_ADDR_RUNLOCK(ifp);
goto done;
}
}
}
- IF_ADDR_UNLOCK(ifp);
+ IF_ADDR_RUNLOCK(ifp);
}
done:
IFNET_RUNLOCK();
OpenPOWER on IntegriCloud