Thread (7 messages) flat view 7 messages, 2 authors, 2010-03-17
STALE6022d

[Patch] netpoll: allow spaces in its parameter

From: Amerigo Wang <hidden>
Date: 2010-03-17 05:53:30
Also in: lkml
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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 , 66666@192.168.0.2/".

Signed-off-by: WANG Cong <redacted>
Cc: David Miller <davem@davemloft.net>

---
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 7aa6972..bf3b2f0 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help