summaryrefslogtreecommitdiff
path: root/sys/net/if_spppsubr.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-11-10 15:51:25 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-11-10 15:51:25 +0000
commit67680ffa08ea8739b777a8b57ac3ac62eb1b1c2f (patch)
tree28d84f0566badb4b35cd162f9bb53a93e96e75d0 /sys/net/if_spppsubr.c
parent69fb630aba24c73ac8c8c98da1b02370f5cc9489 (diff)
Make ifq and ifiq interface MP safe.
Rename ifq_set_maxlen() to ifq_init_maxlen(). This function neither uses WRITE_ONCE() nor a mutex and is called before the ifq mutex is initialized. The new name expresses that it should be used only during interface attach when there is no concurrency. Protect ifq_len(), ifq_empty(), ifiq_len(), and ifiq_empty() with READ_ONCE(). They can be used without lock as they only read a single integer. OK dlg@
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r--sys/net/if_spppsubr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 7254ee7b93d..fb0efa59247 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.191 2022/01/02 22:36:03 jsg Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.192 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Synchronous PPP link level subroutines.
*
@@ -713,7 +713,7 @@ sppp_attach(struct ifnet *ifp)
sp->pp_if.if_type = IFT_PPP;
sp->pp_if.if_output = sppp_output;
sp->pp_if.if_rtrequest = sppp_rtrequest;
- ifq_set_maxlen(&sp->pp_if.if_snd, 50);
+ ifq_init_maxlen(&sp->pp_if.if_snd, 50);
mq_init(&sp->pp_cpq, 50, IPL_NET);
sp->pp_loopcnt = 0;
sp->pp_alivecnt = 0;