OSDN Git Service

arp: correct return value of arp_rcv
authorZhang Shengju <zhangshengju@cmss.chinamobile.com>
Fri, 4 Mar 2016 14:07:54 +0000 (14:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Mar 2016 19:55:04 +0000 (14:55 -0500)
commit8dfd329fbc240729938d24bf87aca49ea89289c5
treea8767866d67312c2a9506c127e51c64582443a42
parent8303394d811ad4e1245b2d72e15c39880ec3d0ff
arp: correct return value of arp_rcv

Currently, arp_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.

v1->v2:
If sanity check is failed, call kfree_skb() instead of consume_skb(), then
return the correct return value.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/arp.c