diff options
author | Sridhar Samudrala <sri@us.ibm.com> | 2010-07-27 05:10:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-28 00:02:42 -0400 |
commit | ba01877f56c3244b21746d3f1537f7647ed97984 (patch) | |
tree | 4ec17efb2261d933b5b1f4839a2ec03e8ca4f96f /drivers/net | |
parent | bb7e95c8fd859922c6cf3ebbb3a8546007df1748 (diff) |
macvlan: Fix rx counters update in macvlan_handle_frame()
Fix macvlan_handle_frame() to update the rx counters based
on the return value of the vlan->receive call.
Updated the patch to not do any packet count drops when the interface
is down based on Herber'ts comments.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/macvlan.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 6e9da96a87b2..0ef0eb0db945 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -158,7 +158,8 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb) | |||
158 | const struct macvlan_dev *vlan; | 158 | const struct macvlan_dev *vlan; |
159 | const struct macvlan_dev *src; | 159 | const struct macvlan_dev *src; |
160 | struct net_device *dev; | 160 | struct net_device *dev; |
161 | unsigned int len; | 161 | unsigned int len = 0; |
162 | int ret = NET_RX_DROP; | ||
162 | 163 | ||
163 | port = macvlan_port_get_rcu(skb->dev); | 164 | port = macvlan_port_get_rcu(skb->dev); |
164 | if (is_multicast_ether_addr(eth->h_dest)) { | 165 | if (is_multicast_ether_addr(eth->h_dest)) { |
@@ -195,14 +196,16 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb) | |||
195 | } | 196 | } |
196 | len = skb->len + ETH_HLEN; | 197 | len = skb->len + ETH_HLEN; |
197 | skb = skb_share_check(skb, GFP_ATOMIC); | 198 | skb = skb_share_check(skb, GFP_ATOMIC); |
198 | macvlan_count_rx(vlan, len, skb != NULL, 0); | ||
199 | if (!skb) | 199 | if (!skb) |
200 | return NULL; | 200 | goto out; |
201 | 201 | ||
202 | skb->dev = dev; | 202 | skb->dev = dev; |
203 | skb->pkt_type = PACKET_HOST; | 203 | skb->pkt_type = PACKET_HOST; |
204 | 204 | ||
205 | vlan->receive(skb); | 205 | ret = vlan->receive(skb); |
206 | |||
207 | out: | ||
208 | macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, 0); | ||
206 | return NULL; | 209 | return NULL; |
207 | } | 210 | } |
208 | 211 | ||