diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2017-01-05 22:06:22 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-05 23:03:41 +0300 |
commit | c1878f7a89efbbe1ac0082d09b2928782a6ceba1 (patch) | |
tree | 04dab5c2650cddd666620ca3972d8e8b9634e78e /fs/notify | |
parent | ad02c4f547826167a709dab8a89a1caefd2c1f50 (diff) | |
download | linux-c1878f7a89efbbe1ac0082d09b2928782a6ceba1.tar.xz |
tools: psock_tpacket: block Rx until socket filter has been added and socket has been bound to loopback.
Packets from any/all interfaces may be queued up on the PF_PACKET socket
before it is bound to the loopback interface by psock_tpacket, and
when these are passed up by the kernel, they could interfere
with the Rx tests.
Avoid interference from spurious packet by blocking Rx until the
socket filter has been set up, and the packet has been bound to the
desired (lo) interface. The effective sequence is
socket(PF_PACKET, SOCK_RAW, 0);
set up ring
Invoke SO_ATTACH_FILTER
bind to sll_protocol set to ETH_P_ALL, sll_ifindex for lo
After this sequence, the only packets that will be passed up are
those received on loopback that pass the attached filter.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/notify')
0 files changed, 0 insertions, 0 deletions