summaryrefslogtreecommitdiff
path: root/sys/net/if_pppx.c
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-07-15 22:56:14 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2022-07-15 22:56:14 +0000
commit153b22127aea5bffdd5e5973c1e0afe13dbbe290 (patch)
tree48ab900edcefde128debe5a18d0031a93b059de9 /sys/net/if_pppx.c
parentb6dac4ff173939220615f1255ce70a4ff32bd269 (diff)
Introduce fine grained pipex(4) locking. Use per-session `pxs_mtx'
mutex(9) to protect session context. Except MPPE encryption, PPPOE sessions are mostly immutable, so no lock required for that case. Global pipex(4) data is already protected by `pipex_list_mtx' mutex(9), so pipex(4) doesn't rely on netlock anymore. Recursion was removed from pipex_mppe_input() and pipex_mppe_output(). ok bluhm@
Diffstat (limited to 'sys/net/if_pppx.c')
-rw-r--r--sys/net/if_pppx.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c
index c76ee3ed8f6..df24dbf4ba2 100644
--- a/sys/net/if_pppx.c
+++ b/sys/net/if_pppx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppx.c,v 1.118 2022/07/02 08:50:42 visa Exp $ */
+/* $OpenBSD: if_pppx.c,v 1.119 2022/07/15 22:56:13 mvs Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
@@ -637,8 +637,6 @@ pppx_add_session(struct pppx_dev *pxd, struct pipex_session_req *req)
ifp->if_softc = pxi;
/* ifp->if_rdomain = req->pr_rdomain; */
if_counters_alloc(ifp);
- /* XXXSMP: be sure pppx_if_qstart() called with NET_LOCK held */
- ifq_set_maxlen(&ifp->if_snd, 1);
/* XXXSMP breaks atomicity */
NET_UNLOCK();
@@ -779,7 +777,6 @@ pppx_if_qstart(struct ifqueue *ifq)
struct mbuf *m;
int proto;
- NET_ASSERT_LOCKED();
while ((m = ifq_dequeue(ifq)) != NULL) {
proto = *mtod(m, int *);
m_adj(m, sizeof(proto));
@@ -1022,8 +1019,6 @@ pppacopen(dev_t dev, int flags, int mode, struct proc *p)
ifp->if_output = pppac_output;
ifp->if_qstart = pppac_qstart;
ifp->if_ioctl = pppac_ioctl;
- /* XXXSMP: be sure pppac_qstart() called with NET_LOCK held */
- ifq_set_maxlen(&ifp->if_snd, 1);
if_counters_alloc(ifp);
if_attach(ifp);
@@ -1398,7 +1393,6 @@ pppac_qstart(struct ifqueue *ifq)
struct ip ip;
int rv;
- NET_ASSERT_LOCKED();
while ((m = ifq_dequeue(ifq)) != NULL) {
#if NBPFILTER > 0
if (ifp->if_bpf) {