Skip to content

Commit

Permalink
net: bridge: don't increment tx_dropped in br_do_proxy_arp
Browse files Browse the repository at this point in the history
pskb_may_pull may fail due to various reasons (e.g. alloc failure), but the
skb isn't changed/dropped and processing continues so we shouldn't
increment tx_dropped.

CC: Kyeyoon Park <kyeyoonp@codeaurora.org>
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: bridge@lists.linux-foundation.org
Fixes: 9585011 ("bridge: Add support for IEEE 802.11 Proxy ARP")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Sep 1, 2016
1 parent 29c994e commit 85a3d4a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/bridge/br_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,10 @@ static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br,

BR_INPUT_SKB_CB(skb)->proxyarp_replied = false;

if (dev->flags & IFF_NOARP)
if ((dev->flags & IFF_NOARP) ||
!pskb_may_pull(skb, arp_hdr_len(dev)))
return;

if (!pskb_may_pull(skb, arp_hdr_len(dev))) {
dev->stats.tx_dropped++;
return;
}
parp = arp_hdr(skb);

if (parp->ar_pro != htons(ETH_P_IP) ||
Expand Down

0 comments on commit 85a3d4a

Please sign in to comment.