linux/tools/testing/selftests/net
Mike Maloney c1f8d0f98c selftests/net: Fixes psock_fanout CBPF test case
'psock_fanout' has been failing since commit 4d7b9dc1f3 ("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: 4d7b9dc1f3 ("tools: psock_lib: harden socket filter used by psock tests")
Signed-off-by: 'Mike Maloney <maloneykernel@gmail.com>'
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-04-20 15:39:19 -04:00
..
.gitignore reuseport, bpf: add test case for bpf_get_numa_node_id 2016-10-22 17:05:52 -04:00
config selftests: create test-specific kconfig fragments 2016-02-25 09:47:52 -07:00
Makefile selftests: add default rules for c source file 2017-01-05 13:42:01 -07:00
psock_fanout.c selftests/net: Fixes psock_fanout CBPF test case 2017-04-20 15:39:19 -04:00
psock_lib.h selftests/net: Fixes psock_fanout CBPF test case 2017-04-20 15:39:19 -04:00
psock_tpacket.c tools: psock_tpacket: block Rx until socket filter has been added and socket has been bound to loopback. 2017-01-05 15:03:41 -05:00
reuseport_bpf_cpu.c soreuseport: BPF selection functional test for TCP 2016-02-11 03:54:15 -05:00
reuseport_bpf_numa.c reuseport, bpf: add test case for bpf_get_numa_node_id 2016-10-22 17:05:52 -04:00
reuseport_bpf.c soreuseport: Fix reuseport_bpf testcase on 32bit architectures 2016-06-06 15:20:16 -07:00
reuseport_dualstack.c soreuseport: test mixed v4/v6 sockets 2016-04-14 21:14:04 -04:00
run_afpackettests selftests: Introduce minimal shared logic for running tests 2015-03-13 15:13:40 -06:00
run_netsocktests selftests: do not require bash to run netsocktests testcase 2017-01-05 13:19:53 -07:00
socket.c
test_bpf.sh selftests/net: move test out of Makefile into a shell script 2014-11-05 08:12:40 -07:00