diff options
author | Zhang Shengju <zhangshengju@cmss.chinamobile.com> | 2016-12-07 09:52:53 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-08 19:24:23 +0300 |
commit | f91c58d68b8638530e0eb2fec76c5b9e429ca39a (patch) | |
tree | 4be17facb53f59cb38c6a20a330e0fe42bf0e121 /net | |
parent | 5fccd64aa44829f87997e3342698ef98862adffd (diff) | |
download | linux-f91c58d68b8638530e0eb2fec76c5b9e429ca39a.tar.xz |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/icmp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 691146abde2d..f79d7a8ab1c6 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -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: |