diff options
author | Ying Xue <ying.xue@windriver.com> | 2013-10-18 01:23:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-18 13:20:43 -0400 |
commit | 679815834857d5305dae108a03addccf16d86868 (patch) | |
tree | 70da3017c0cb87ac18b0a9e01e54e147aaaff6b3 /net/tipc | |
parent | f2875c3cc4769d07bab3bc6e51c386840a7de280 (diff) |
tipc: correct return value of recv_msg routine
Currently, rcv_msg() always returns zero on a packet delivery upcall
from net_device.
To make its behavior more compliant with the way this API should be
used, we change this to let it return NET_RX_SUCCESS (which is zero
anyway) when it is able to handle the packet, and NET_RX_DROP otherwise.
The latter does not imply any functional change, it only enables the
driver to keep more accurate statistics about the fate of delivered
packets.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/eth_media.c | 6 | ||||
-rw-r--r-- | net/tipc/ib_media.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index c36c938306a1..f80d59f5a161 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c | |||
@@ -132,18 +132,18 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev, | |||
132 | 132 | ||
133 | if (!net_eq(dev_net(dev), &init_net)) { | 133 | if (!net_eq(dev_net(dev), &init_net)) { |
134 | kfree_skb(buf); | 134 | kfree_skb(buf); |
135 | return 0; | 135 | return NET_RX_DROP; |
136 | } | 136 | } |
137 | 137 | ||
138 | if (likely(eb_ptr->bearer)) { | 138 | if (likely(eb_ptr->bearer)) { |
139 | if (likely(buf->pkt_type <= PACKET_BROADCAST)) { | 139 | if (likely(buf->pkt_type <= PACKET_BROADCAST)) { |
140 | buf->next = NULL; | 140 | buf->next = NULL; |
141 | tipc_recv_msg(buf, eb_ptr->bearer); | 141 | tipc_recv_msg(buf, eb_ptr->bearer); |
142 | return 0; | 142 | return NET_RX_SUCCESS; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | kfree_skb(buf); | 145 | kfree_skb(buf); |
146 | return 0; | 146 | return NET_RX_DROP; |
147 | } | 147 | } |
148 | 148 | ||
149 | /** | 149 | /** |
diff --git a/net/tipc/ib_media.c b/net/tipc/ib_media.c index 20b1aa464321..c13989297464 100644 --- a/net/tipc/ib_media.c +++ b/net/tipc/ib_media.c | |||
@@ -125,18 +125,18 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev, | |||
125 | 125 | ||
126 | if (!net_eq(dev_net(dev), &init_net)) { | 126 | if (!net_eq(dev_net(dev), &init_net)) { |
127 | kfree_skb(buf); | 127 | kfree_skb(buf); |
128 | return 0; | 128 | return NET_RX_DROP; |
129 | } | 129 | } |
130 | 130 | ||
131 | if (likely(ib_ptr->bearer)) { | 131 | if (likely(ib_ptr->bearer)) { |
132 | if (likely(buf->pkt_type <= PACKET_BROADCAST)) { | 132 | if (likely(buf->pkt_type <= PACKET_BROADCAST)) { |
133 | buf->next = NULL; | 133 | buf->next = NULL; |
134 | tipc_recv_msg(buf, ib_ptr->bearer); | 134 | tipc_recv_msg(buf, ib_ptr->bearer); |
135 | return 0; | 135 | return NET_RX_SUCCESS; |
136 | } | 136 | } |
137 | } | 137 | } |
138 | kfree_skb(buf); | 138 | kfree_skb(buf); |
139 | return 0; | 139 | return NET_RX_DROP; |
140 | } | 140 | } |
141 | 141 | ||
142 | /** | 142 | /** |