diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-12-19 08:36:51 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-12-19 08:36:51 +0000 |
commit | 347b9bada49618963c84880ec8c3c23c96aa0017 (patch) | |
tree | d431218ec3017a484e7de695c002a79a0e68cc86 /sys/net/if_spppsubr.c | |
parent | c22be17b5bebb223df391aa82dfc7704004aafa7 (diff) |
Introduce the NET_LOCK() a rwlock used to serialize accesses to the parts
of the network stack that are not yet ready to be executed in parallel or
where new sleeping points are not possible.
This first pass replace all the entry points leading to ip_output(). This
is done to not introduce new sleeping points when trying to acquire ART's
write lock, needed when a new L2 entry is created via the RT_RESOLVE.
Inputs from and ok bluhm@, ok dlg@
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r-- | sys/net/if_spppsubr.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index b0046bffa40..06524edc001 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.156 2016/11/16 14:25:19 mpi Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.157 2016/12/19 08:36:49 mpi Exp $ */ /* * Synchronous PPP link level subroutines. * @@ -4193,7 +4193,7 @@ sppp_set_ip_addrs(void *arg1) struct sockaddr_in *si; struct sockaddr_in *dest; int s; - + sppp_get_ip_addrs(sp, &myaddr, &hisaddr, NULL); if ((sp->ipcp.flags & IPCP_MYADDR_DYN) && (sp->ipcp.flags & IPCP_MYADDR_SEEN)) @@ -4202,8 +4202,8 @@ sppp_set_ip_addrs(void *arg1) (sp->ipcp.flags & IPCP_HISADDR_SEEN)) hisaddr = sp->ipcp.req_hisaddr; - s = splsoftnet(); + NET_LOCK(s); /* * Pick the first AF_INET address from the list, * aliases don't make any sense on a p2p link anyway. @@ -4242,12 +4242,12 @@ sppp_set_ip_addrs(void *arg1) if (debug && error) { log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addrs: in_ifinit " " failed, error=%d\n", SPP_ARGS(ifp), error); - splx(s); + NET_UNLOCK(s); return; } sppp_update_gw(ifp); } - splx(s); + NET_UNLOCK(s); } /* @@ -4266,7 +4266,7 @@ sppp_clear_ip_addrs(void *arg1) u_int32_t remote; int s; - s = splsoftnet(); + NET_LOCK(s); if (sp->ipcp.flags & IPCP_HISADDR_DYN) remote = sp->ipcp.saved_hisaddr; @@ -4303,12 +4303,12 @@ sppp_clear_ip_addrs(void *arg1) if (debug && error) { log(LOG_DEBUG, SPP_FMT "sppp_clear_ip_addrs: in_ifinit " " failed, error=%d\n", SPP_ARGS(ifp), error); - splx(s); + NET_UNLOCK(s); return; } sppp_update_gw(ifp); } - splx(s); + NET_UNLOCK(s); } |