diff options
author | Amerigo Wang <amwang@redhat.com> | 2010-03-21 22:59:58 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-22 20:05:45 -0700 |
commit | 5fc05f8764f301138003ff562a31ad3721f1675f (patch) | |
tree | 7c5a3d9179ce0fc23829302149aaa1d2e1d1a4ab /net | |
parent | 21afc27c9f9ae1f6370c47b323be7f3b75106569 (diff) | |
download | linux-stable-5fc05f8764f301138003ff562a31ad3721f1675f.tar.gz linux-stable-5fc05f8764f301138003ff562a31ad3721f1675f.tar.bz2 linux-stable-5fc05f8764f301138003ff562a31ad3721f1675f.zip |
netpoll: warn when there are spaces in parameters
v2: update according to Frans' comments.
Currently, if we leave spaces before dst port,
netconsole will silently accept it as 0. Warn about this.
Also, when spaces appear in other places, make them
visible in error messages.
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: David Miller <davem@davemloft.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/netpoll.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index d4ec38fa64e6..6f9206b36dc2 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -614,7 +614,7 @@ void netpoll_print_options(struct netpoll *np) np->name, np->local_port); printk(KERN_INFO "%s: local IP %pI4\n", np->name, &np->local_ip); - printk(KERN_INFO "%s: interface %s\n", + printk(KERN_INFO "%s: interface '%s'\n", np->name, np->dev_name); printk(KERN_INFO "%s: remote port %d\n", np->name, np->remote_port); @@ -661,6 +661,9 @@ int netpoll_parse_options(struct netpoll *np, char *opt) if ((delim = strchr(cur, '@')) == NULL) goto parse_failed; *delim = 0; + if (*cur == ' ' || *cur == '\t') + printk(KERN_INFO "%s: warning: whitespace" + "is not allowed\n", np->name); np->remote_port = simple_strtol(cur, NULL, 10); cur = delim; } @@ -708,7 +711,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) return 0; parse_failed: - printk(KERN_INFO "%s: couldn't parse config at %s!\n", + printk(KERN_INFO "%s: couldn't parse config at '%s'!\n", np->name, cur); return -1; } |