netpoll: allow spaces in its parameter
Subsystems (2)
PATCH 1/1 netpoll: allow spaces in its parameter
It would be nice if we allow spaces in netconsole parameters, otherwise we get weird results if there are spaces in it.
After this patch, we will allow things like:
"netconsole= @192.168.0.1/eth0 , [email protected]/".
---
net/core/netpoll.c +3 -0
@@ -629,6 +629,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)char *cur=opt, *delim;if (*cur !='@' ) { + cur =skip_spaces (cur);if ((delim =strchr (cur,'@' )) ==NULL ) goto parse_failed; *delim =0 ;
@@ -651,12 +652,14 @@ int netpoll_parse_options(struct netpoll *np, char *opt)if ((delim =strchr (cur,',' )) ==NULL ) goto parse_failed; *delim =0 ; +strim (cur);strlcpy (np->dev_name, cur,sizeof (np->dev_name)); cur = delim; } cur++;if (*cur !='@' ) { + cur =skip_spaces (cur);/* dst port */ if ((delim =strchr (cur,'@' )) ==NULL ) goto parse_failed;
David Miller
maintainerFrom: Amerigo Wang <[email protected]>
Date: Wed, 17 Mar 2010 01:53:26 -0400
Quoted 9 lines
It would be nice if we allow spaces in netconsole parameters, otherwise we get weird results if there are spaces in it.
After this patch, we will allow things like:
"netconsole= @192.168.0.1/eth0 , [email protected]/".Signed-off-by WANG Cong <[email protected]>Cc David Miller <[email protected]>
That kernel command line looks absolutely awful, not better.
Sorry I'm not applying this.
Quoted 9 lines · David Miller
From: Amerigo Wang <[email protected]>
Date: Wed, 17 Mar 2010 01:53:26 -0400Quoted 6 lines
It would be nice if we allow spaces in netconsole parameters, otherwise we get weird results if there are spaces in it.
After this patch, we will allow things like:
"netconsole= @192.168.0.1/eth0 , [email protected]/".
Quoted 7 lines
Quoted 2 lines
Signed-off-by WANG Cong <[email protected]>Cc David Miller <[email protected]>That kernel command line looks absolutely awful, not better.
Sorry I'm not applying this.
The problem is that the dst port is 0 when I even use:
"[email protected]/eth0, [email protected]/"
This is awful too? I don't think so...
David Miller
maintainerFrom: Cong Wang <[email protected]>
Date: Wed, 17 Mar 2010 14:01:06 +0800
Quoted 5 lines
The problem is that the dst port is 0 when I even use:
"[email protected]/eth0, [email protected]/"
This is awful too? I don't think so...
It's very simple, don't use spaces. Is it so difficult to follow this rule?
"ipconfig" does it as do a host of other kernel command line options.
There is no real reason to make netconsle= special in this regard, really.
Quoted 12 lines · David Miller
From: Cong Wang <[email protected]>
Date: Wed, 17 Mar 2010 14:01:06 +0800Quoted 5 lines
The problem is that the dst port is 0 when I even use:
"[email protected]/eth0, [email protected]/"
This is awful too? I don't think so...
It's very simple, don't use spaces. Is it so difficult to follow this rule?
No, but silently accepting it as 0 is not correct, why don't reject it if it is not allowed?
David Miller
maintainerFrom: Cong Wang <[email protected]>
Date: Wed, 17 Mar 2010 14:07:57 +0800
Quoted 2 lines
No, but silently accepting it as 0 is not correct, why don't reject it if it is not allowed?
You have to be careful even with that. For example, if two netconsoles are specified, seeing the space shouldn't kill the first netconsole specification we parsed.
A warning perhaps, but outright rejection of all specifications is really bad behavior.
Quoted 6 lines · David Miller
From: Cong Wang <[email protected]>
Date: Wed, 17 Mar 2010 14:07:57 +0800Quoted 2 lines
No, but silently accepting it as 0 is not correct, why don't reject it if it is not allowed?
Quoted 6 lines
You have to be careful even with that. For example, if two netconsoles are specified, seeing the space shouldn't kill the first netconsole specification we parsed.
A warning perhaps, but outright rejection of all specifications is really bad behavior.
OK, I will put a warning there instead.
Thanks, David!