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: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Zhang Shengju 2016-12-07 14:52:53 +08:00 committed by David S. Miller
parent 5fccd64aa4
commit f91c58d68b
1 changed files with 2 additions and 2 deletions

View File

@ -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: