Skip to content

Commit

Permalink
icmp: correct return value of icmp_rcv()
Browse files Browse the repository at this point in the history
Currently, icmp_rcv() always return zero on a packet delivery upcall.

To make its behavior more compliant with the way this API should be
used, this patch changes this to let it return NET_RX_SUCCESS when the
packet is proper handled, and NET_RX_DROP otherwise.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zhang Shengju authored and David S. Miller committed Dec 8, 2016
1 parent 5fccd64 commit f91c58d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,12 +1047,12 @@ int icmp_rcv(struct sk_buff *skb)

if (success) {
consume_skb(skb);
return 0;
return NET_RX_SUCCESS;
}

drop:
kfree_skb(skb);
return 0;
return NET_RX_DROP;
csum_error:
__ICMP_INC_STATS(net, ICMP_MIB_CSUMERRORS);
error:
Expand Down

0 comments on commit f91c58d

Please sign in to comment.