Page MenuHomeFreeBSD

pf: Avoid taking the pf rules write lock in a couple of ioctls
AcceptedPublic

Authored by markj on Thu, Dec 18, 6:13 PM.

Details

Reviewers
kp
allanjude
Summary

The DIOCGETRULES ioctl handlers has taken the write lock ever since
fine-grained locking was merged to pf, but I believe it's unneeded. Use
the read lock instead.

DIOCGETRULENV takes the write lock as well but I believe this is only
required when clearing rule counters. (It might not be required even
then, on platforms where counter increment is done atomically.) Acquire
the read lock if that is not the case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69378
Build 66261: arc lint + arc unit