Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33405
b: refs/heads/master
c: c7fa9d1
h: refs/heads/master
i:
  33403: f02b275
v: v3
  • Loading branch information
David S. Miller committed Aug 17, 2006
1 parent 9a41ecf commit 62b0d8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4274b51a5c8147b5341e15927368e75b632d297
refs/heads/master: c7fa9d189e93877a1fa08ab00f230e0689125e45
19 changes: 14 additions & 5 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 62b0d8f

Please sign in to comment.