Skip to contentSkip to conversation

net: warn about spaces in device names

PATCH New Mike Frysinger 2 participants 2 messages Jun 10, 2010 – Jun 21, 2010 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: warn about spaces in device names

Some commands operate on eth device names (like 'mii'), but those cannot be passed on the command line as one argument. So detect devices like these and warn about them so someone will fix it.

---
 net/eth.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
net/eth.c +3 -0
index b650a20..40e66e5 100644
@@ -225,6 +225,9 @@ int eth_initialize(bd_t *bis)
 				puts (" [PRIME]");
 			}
 
+			if (strchr(dev->name, ' '))
+				puts("\nWarning: eth device name has a space!\n");
+
 			eth_getenv_enetaddr_by_index(eth_number, env_enetaddr);
 
 			if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
Signature · 1 line
1.7.1
Applied
#1 lore raw

PATCH 1/1 net: warn about spaces in device names

Hi Mike,

Quoted 15 lines · Mike Frysinger

Some commands operate on eth device names (like 'mii'), but those cannot be passed on the command line as one argument. So detect devices like these and warn about them so someone will fix it.

---
  net/eth.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
net/eth.c +0 -0
index b650a20..40e66e5 100644

net/eth.c int eth_initialize(bd_t *bis) · line 233

Quoted 9 lines
net/eth.c +3 -0
@@ -225,6 +225,9 @@ int eth_initialize(bd_t *bis)
  				puts (" [PRIME]");
  			}
 
+			if (strchr(dev->name, ' '))
+				puts("\nWarning: eth device name has a space!\n");
+
  			eth_getenv_enetaddr_by_index(eth_number, env_enetaddr);
 
  			if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {

Applied to net/next.

regards,
Ben