Commit f91c58d6 authored by Zhang Shengju's avatar Zhang Shengju Committed by David S. Miller

icmp: correct return value of icmp_rcv()

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: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5fccd64a
...@@ -1047,12 +1047,12 @@ int icmp_rcv(struct sk_buff *skb) ...@@ -1047,12 +1047,12 @@ int icmp_rcv(struct sk_buff *skb)
if (success) { if (success) {
consume_skb(skb); consume_skb(skb);
return 0; return NET_RX_SUCCESS;
} }
drop: drop:
kfree_skb(skb); kfree_skb(skb);
return 0; return NET_RX_DROP;
csum_error: csum_error:
__ICMP_INC_STATS(net, ICMP_MIB_CSUMERRORS); __ICMP_INC_STATS(net, ICMP_MIB_CSUMERRORS);
error: error:
......
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