aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlexander Drozdov <al.drozdov@gmail.com>2015-03-23 02:11:12 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-23 22:00:36 -0400
commit68c2e5de360411674d9821ee2b46f5d8ee965161 (patch)
treee68cac5be8d3c5fb6e5b47c48e48bd9c8703e8de /net
parentc69736696cf3742b37d850289dc0d7ead177bb14 (diff)
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>
Diffstat (limited to 'net')
-rw-r--r--net/packet/af_packet.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index b91ac5946ad1..9d854c5ce0b5 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1916,14 +1916,15 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
1916 } 1916 }
1917 } 1917 }
1918 1918
1919 if (skb->ip_summed == CHECKSUM_PARTIAL)
1920 status |= TP_STATUS_CSUMNOTREADY;
1921
1922 snaplen = skb->len; 1919 snaplen = skb->len;
1923 1920
1924 res = run_filter(skb, sk, snaplen); 1921 res = run_filter(skb, sk, snaplen);
1925 if (!res) 1922 if (!res)
1926 goto drop_n_restore; 1923 goto drop_n_restore;
1924
1925 if (skb->ip_summed == CHECKSUM_PARTIAL)
1926 status |= TP_STATUS_CSUMNOTREADY;
1927
1927 if (snaplen > res) 1928 if (snaplen > res)
1928 snaplen = res; 1929 snaplen = res;
1929 1930