Skip to content
Commit c1f8d0f9 authored by Mike Maloney's avatar Mike Maloney Committed by David S. Miller
Browse files

selftests/net: Fixes psock_fanout CBPF test case

'psock_fanout' has been failing since commit 4d7b9dc1 ("tools:
psock_lib: harden socket filter used by psock tests").  That commit
changed the CBPF filter to examine the full ethernet frame, and was
tested on 'psock_tpacket' which uses SOCK_RAW.  But 'psock_fanout' was
also using this same CBPF in two places, for filtering and fanout, on a
SOCK_DGRAM socket.

Change 'psock_fanout' to use SOCK_RAW so that the CBPF program used with
SO_ATTACH_FILTER can examine the entire frame.  Create a new CBPF
program for use with PACKET_FANOUT_DATA which ignores the header, as it
cannot see the ethernet header.

Tested: Ran tools/testing/selftests/net/psock_{fanout,tpacket} 10 times,
and they all passed.

Fixes: 4d7b9dc1

 ("tools: psock_lib: harden socket filter used by psock tests")
Signed-off-by: default avatar'Mike Maloney <maloneykernel@gmail.com&gt;'>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3018e947
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment