From: kn Date: Sat, 29 Apr 2023 10:25:32 +0000 (+0000) Subject: Remove net lock from DIOCGETQUEUE X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6b2e8558fae158473483b735ef90cea2178e36d9;p=openbsd Remove net lock from DIOCGETQUEUE Same logic and argument as for the parent *S ioctl unlocked in r1.400, might as well have committed them together: Both ticket and number of queues stem from the pf_queues_active list which is effectively static to pf_ioctl.c and fully protected by the pf lock. OK sashan --- diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index cbf3509ad5f..61a1660766d 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.401 2023/04/28 14:08:38 sashan Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.402 2023/04/29 10:25:32 kn Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1231,12 +1231,10 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) struct pf_queuespec *qs; u_int32_t nr = 0; - NET_LOCK(); PF_LOCK(); if (pq->ticket != pf_main_ruleset.rules.active.version) { error = EBUSY; PF_UNLOCK(); - NET_UNLOCK(); goto fail; } @@ -1247,12 +1245,10 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) if (qs == NULL) { error = EBUSY; PF_UNLOCK(); - NET_UNLOCK(); goto fail; } memcpy(&pq->queue, qs, sizeof(pq->queue)); PF_UNLOCK(); - NET_UNLOCK(); break; }