Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

af_packet: make tpacket_rcv to not set status value before run_filter

It is just an optimization. We don't need the value of status variable
if the packet is filtered.

Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexander Drozdov and committed by
David S. Miller
68c2e5de c6973669

+4 -3
+4 -3
net/packet/af_packet.c
··· 1916 1916 } 1917 1917 } 1918 1918 1919 - if (skb->ip_summed == CHECKSUM_PARTIAL) 1920 - status |= TP_STATUS_CSUMNOTREADY; 1921 - 1922 1919 snaplen = skb->len; 1923 1920 1924 1921 res = run_filter(skb, sk, snaplen); 1925 1922 if (!res) 1926 1923 goto drop_n_restore; 1924 + 1925 + if (skb->ip_summed == CHECKSUM_PARTIAL) 1926 + status |= TP_STATUS_CSUMNOTREADY; 1927 + 1927 1928 if (snaplen > res) 1928 1929 snaplen = res; 1929 1930