1
0
Fork 0
freescale-linux-fslc/tools/testing
Sowmini Varadhan c1878f7a89 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>
2017-01-05 15:03:41 -05:00
..
fault-injection fault-injection: fix failcmd.sh warning 2012-07-31 18:42:38 -07:00
ktest ktest.pl: fix english 2016-12-14 16:04:08 -08:00
nvdimm Merge branch 'for-4.10/libnvdimm' into libnvdimm-for-next 2016-12-17 15:08:10 -08:00
radix-tree redo: radix tree test suite: fix compilation 2016-12-15 11:04:20 -08:00
selftests 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