aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2006-08-22 14:42:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-08-22 14:42:36 -0400
commit69758820a42da207bdc775d6eccf1f9fb67cd62e (patch)
tree4c4dd2b596aa5535231656bf0fa1bc65a8b17471 /net/core/dev.c
parent113b898e38cb20e80847c24154ce62273b948c6a (diff)
parentef7d1b244fa6c94fb76d5f787b8629df64ea4046 (diff)
downloadkernel_samsung_aries-69758820a42da207bdc775d6eccf1f9fb67cd62e.zip
kernel_samsung_aries-69758820a42da207bdc775d6eccf1f9fb67cd62e.tar.gz
kernel_samsung_aries-69758820a42da207bdc775d6eccf1f9fb67cd62e.tar.bz2
Merge branch 'from-linus' into upstream
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d95e262..d4a1ec3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -116,6 +116,7 @@
#include <linux/audit.h>
#include <linux/dmaengine.h>
#include <linux/err.h>
+#include <linux/ctype.h>
/*
* The list of packet types we will receive (as opposed to discard)
@@ -632,14 +633,22 @@ struct net_device * dev_get_by_flags(unsigned short if_flags, unsigned short mas
* @name: name string
*
* Network device names need to be valid file names to
- * to allow sysfs to work
+ * to allow sysfs to work. We also disallow any kind of
+ * whitespace.
*/
int dev_valid_name(const char *name)
{
- return !(*name == '\0'
- || !strcmp(name, ".")
- || !strcmp(name, "..")
- || strchr(name, '/'));
+ if (*name == '\0')
+ return 0;
+ if (!strcmp(name, ".") || !strcmp(name, ".."))
+ return 0;
+
+ while (*name) {
+ if (*name == '/' || isspace(*name))
+ return 0;
+ name++;
+ }
+ return 1;
}
/**
@@ -1619,26 +1628,10 @@ static inline struct net_device *skb_bond(struct sk_buff *skb)
struct net_device *dev = skb->dev;
if (dev->master) {
- /*
- * On bonding slaves other than the currently active
- * slave, suppress duplicates except for 802.3ad
- * ETH_P_SLOW and alb non-mcast/bcast.
- */
- if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
- if (dev->master->priv_flags & IFF_MASTER_ALB) {
- if (skb->pkt_type != PACKET_BROADCAST &&
- skb->pkt_type != PACKET_MULTICAST)
- goto keep;
- }
-
- if (dev->master->priv_flags & IFF_MASTER_8023AD &&
- skb->protocol == __constant_htons(ETH_P_SLOW))
- goto keep;
-
+ if (skb_bond_should_drop(skb)) {
kfree_skb(skb);
return NULL;
}
-keep:
skb->dev = dev->master;
}