aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-21 12:08:21 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-21 12:08:21 -0500
commitac58c9059da8886b5e8cde012a80266b18ca146e (patch)
tree40bf486843a2cace6c3a959d73423e50e6aa0c00 /net/core/dev.c
parentdf6db302cb236ac3a683d535a3e2073d9f4b2833 (diff)
parentc4a1745aa09fc110afdefea0e5d025043e348bae (diff)
Merge branch 'linus'
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 2afb0de95329..ef56c035d44e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -110,10 +110,8 @@
110#include <linux/netpoll.h> 110#include <linux/netpoll.h>
111#include <linux/rcupdate.h> 111#include <linux/rcupdate.h>
112#include <linux/delay.h> 112#include <linux/delay.h>
113#ifdef CONFIG_NET_RADIO 113#include <linux/wireless.h>
114#include <linux/wireless.h> /* Note : will define WIRELESS_EXT */
115#include <net/iw_handler.h> 114#include <net/iw_handler.h>
116#endif /* CONFIG_NET_RADIO */
117#include <asm/current.h> 115#include <asm/current.h>
118 116
119/* 117/*
@@ -1448,8 +1446,29 @@ static inline struct net_device *skb_bond(struct sk_buff *skb)
1448{ 1446{
1449 struct net_device *dev = skb->dev; 1447 struct net_device *dev = skb->dev;
1450 1448
1451 if (dev->master) 1449 if (dev->master) {
1450 /*
1451 * On bonding slaves other than the currently active
1452 * slave, suppress duplicates except for 802.3ad
1453 * ETH_P_SLOW and alb non-mcast/bcast.
1454 */
1455 if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
1456 if (dev->master->priv_flags & IFF_MASTER_ALB) {
1457 if (skb->pkt_type != PACKET_BROADCAST &&
1458 skb->pkt_type != PACKET_MULTICAST)
1459 goto keep;
1460 }
1461
1462 if (dev->master->priv_flags & IFF_MASTER_8023AD &&
1463 skb->protocol == __constant_htons(ETH_P_SLOW))
1464 goto keep;
1465
1466 kfree_skb(skb);
1467 return NULL;
1468 }
1469keep:
1452 skb->dev = dev->master; 1470 skb->dev = dev->master;
1471 }
1453 1472
1454 return dev; 1473 return dev;
1455} 1474}
@@ -1593,6 +1612,9 @@ int netif_receive_skb(struct sk_buff *skb)
1593 1612
1594 orig_dev = skb_bond(skb); 1613 orig_dev = skb_bond(skb);
1595 1614
1615 if (!orig_dev)
1616 return NET_RX_DROP;
1617
1596 __get_cpu_var(netdev_rx_stat).total++; 1618 __get_cpu_var(netdev_rx_stat).total++;
1597 1619
1598 skb->h.raw = skb->nh.raw = skb->data; 1620 skb->h.raw = skb->nh.raw = skb->data;
@@ -2028,7 +2050,7 @@ static struct file_operations softnet_seq_fops = {
2028 .release = seq_release, 2050 .release = seq_release,
2029}; 2051};
2030 2052
2031#ifdef WIRELESS_EXT 2053#ifdef CONFIG_WIRELESS_EXT
2032extern int wireless_proc_init(void); 2054extern int wireless_proc_init(void);
2033#else 2055#else
2034#define wireless_proc_init() 0 2056#define wireless_proc_init() 0
@@ -2582,7 +2604,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
2582 ret = -EFAULT; 2604 ret = -EFAULT;
2583 return ret; 2605 return ret;
2584 } 2606 }
2585#ifdef WIRELESS_EXT 2607#ifdef CONFIG_WIRELESS_EXT
2586 /* Take care of Wireless Extensions */ 2608 /* Take care of Wireless Extensions */
2587 if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { 2609 if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
2588 /* If command is `set a parameter', or 2610 /* If command is `set a parameter', or
@@ -2603,7 +2625,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
2603 ret = -EFAULT; 2625 ret = -EFAULT;
2604 return ret; 2626 return ret;
2605 } 2627 }
2606#endif /* WIRELESS_EXT */ 2628#endif /* CONFIG_WIRELESS_EXT */
2607 return -EINVAL; 2629 return -EINVAL;
2608 } 2630 }
2609} 2631}