summaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r--net/dsa/dsa.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index d370c8bfa372..1fb9cf7aaaf4 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -23,6 +23,7 @@
23#include <linux/sysfs.h> 23#include <linux/sysfs.h>
24#include <linux/phy_fixed.h> 24#include <linux/phy_fixed.h>
25#include <linux/gpio/consumer.h> 25#include <linux/gpio/consumer.h>
26#include <linux/etherdevice.h>
26#include <net/dsa.h> 27#include <net/dsa.h>
27#include "dsa_priv.h" 28#include "dsa_priv.h"
28 29
@@ -900,6 +901,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
900 struct packet_type *pt, struct net_device *orig_dev) 901 struct packet_type *pt, struct net_device *orig_dev)
901{ 902{
902 struct dsa_switch_tree *dst = dev->dsa_ptr; 903 struct dsa_switch_tree *dst = dev->dsa_ptr;
904 struct sk_buff *nskb = NULL;
903 905
904 if (unlikely(dst == NULL)) { 906 if (unlikely(dst == NULL)) {
905 kfree_skb(skb); 907 kfree_skb(skb);
@@ -910,7 +912,23 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
910 if (!skb) 912 if (!skb)
911 return 0; 913 return 0;
912 914
913 return dst->rcv(skb, dev, pt, orig_dev); 915 nskb = dst->rcv(skb, dev, pt, orig_dev);
916 if (!nskb) {
917 kfree_skb(skb);
918 return 0;
919 }
920
921 skb = nskb;
922 skb_push(skb, ETH_HLEN);
923 skb->pkt_type = PACKET_HOST;
924 skb->protocol = eth_type_trans(skb, skb->dev);
925
926 skb->dev->stats.rx_packets++;
927 skb->dev->stats.rx_bytes += skb->len;
928
929 netif_receive_skb(skb);
930
931 return 0;
914} 932}
915 933
916static struct packet_type dsa_pack_type __read_mostly = { 934static struct packet_type dsa_pack_type __read_mostly = {