Skip to content

Commit 68c2e5d

Browse files
sorc1davem330
authored andcommitted
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>
1 parent c697366 commit 68c2e5d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/packet/af_packet.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,14 +1916,15 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
19161916
}
19171917
}
19181918

1919-
if (skb->ip_summed == CHECKSUM_PARTIAL)
1920-
status |= TP_STATUS_CSUMNOTREADY;
1921-
19221919
snaplen = skb->len;
19231920

19241921
res = run_filter(skb, sk, snaplen);
19251922
if (!res)
19261923
goto drop_n_restore;
1924+
1925+
if (skb->ip_summed == CHECKSUM_PARTIAL)
1926+
status |= TP_STATUS_CSUMNOTREADY;
1927+
19271928
if (snaplen > res)
19281929
snaplen = res;
19291930

0 commit comments

Comments
 (0)