Use shared net lock for DIOCGETIFACES
authorkn <kn@openbsd.org>
Tue, 27 Jun 2023 17:36:56 +0000 (17:36 +0000)
committerkn <kn@openbsd.org>
Tue, 27 Jun 2023 17:36:56 +0000 (17:36 +0000)
commitdfc1a6aabefdbfd088581d3bfa33633abf17eb90
treed42d8f1b69a658d7072e2a9c5cca3e84815ad354
parent6e0981637714f798f12ff476371a439f89155c54
Use shared net lock for DIOCGETIFACES

snmpd(8) and 'pfctl -s Interfaces' dump pf's internal list of interfaces.

pf's internal interface list is completely protected by the pf lock,
pf lock assertions since pf_if.c r1.110 from over a week ago support this.

pfi_*() iterate over net lock protected if_groups lists, but only to read,
so downgrade from exclusive write net lock to a shared read-only one.

Feedback mvs
OK sashan
sys/net/pf_ioctl.c