Commit 68c2e5de authored by Alexander Drozdov's avatar Alexander Drozdov Committed by David S. Miller
Browse files

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: default avatarAlexander Drozdov <>
Signed-off-by: default avatarDavid S. Miller <>
parent c6973669
......@@ -1916,14 +1916,15 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
if (skb->ip_summed == CHECKSUM_PARTIAL)
snaplen = skb->len;
res = run_filter(skb, sk, snaplen);
if (!res)
goto drop_n_restore;
if (skb->ip_summed == CHECKSUM_PARTIAL)
if (snaplen > res)
snaplen = res;
Markdown is supported
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