]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Eliminate rmlock from ipfw's BPF code.
authorae <ae@FreeBSD.org>
Tue, 23 Jul 2019 12:52:36 +0000 (12:52 +0000)
committerae <ae@FreeBSD.org>
Tue, 23 Jul 2019 12:52:36 +0000 (12:52 +0000)
commit5163ded6d44bbff0ec0e868f34b0c3467bb83971
tree9b5b6a9164ab152efb395c97997f7cd4e01b25b9
parent5d004f47124894f3fc291408fc1b42d15752bdb6
Eliminate rmlock from ipfw's BPF code.

After r343631 pfil hooks are invoked in net_epoch_preempt section,
this allows to avoid extra locking. Add NET_EPOCH_ASSER() assertion
to each ipfw_bpf_*tap*() call to require to be called from inside
epoch section.

Use NET_EPOCH_WAIT() in ipfw_clone_destroy() to wait until it becomes
safe to free() ifnet. And use on-stack ifnet pointer in each
ipfw_bpf_*tap*() call to avoid NULL pointer dereference in case when
V_*log_if global variable will become NULL during ipfw_bpf_*tap*() call.

Sponsored by: Yandex LLC
sys/netpfil/ipfw/ip_fw_bpf.c