]> git.ipfire.org Git - thirdparty/suricata.git/commit
af-packet: simplify socket handling in tpacket v3
authorVictor Julien <victor@inliniac.net>
Wed, 3 Nov 2021 20:09:46 +0000 (21:09 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 11 Nov 2021 14:27:24 +0000 (15:27 +0100)
commite3d20acb98141fc8d109302158e898ed388f1b5a
tree45543aa87fc4822f94451ca0cbbdde7d71306c4a
parent6eaaafc360b5a974a6fb7302e57f5c23fc567ad3
af-packet: simplify socket handling in tpacket v3

Tpacket v3 only supports workers mode, which means the packet that would
reference a socket won't leave the thread. Therefore keeping a ref count
on the socket is not needed.

This patch removes the per packet reference count increment. The decrement
was missing, so this fixes the ref cnt handling so that after a iface up/
down capture can recover.

It should also lead to a minor performance increase as we avoid a round
of atomic operations per packet.

Bug: #4804.
Bug: #4801.
src/source-af-packet.c