diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2014-02-06 18:34:12 +0100 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-02-26 10:22:51 +0100 |
commit | 7b694760856cc5059b550724d3030e53c7cfd2d2 (patch) | |
tree | da9aec64ee62ac075c6a4f3935562e12375ccca9 /net | |
parent | 7d9c1b6b1e2730813b4d8692e5a51785fbd378db (diff) |
netpoll: fix netconsole IPv6 setup
[ Upstream commit 00fe11b3c67dc670fe6391d22f1fe64e7c99a8ec ]
Currently, to make netconsole start over IPv6, the source address
needs to be specified. Without a source address, netpoll_parse_options
assumes we're setting up over IPv4 and the destination IPv6 address is
rejected.
Check if the IP version has been forced by a source address before
checking for a version mismatch when parsing the destination address.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/netpoll.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 0c1482c6ff9..462cdc97fad 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -943,6 +943,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) { char *cur=opt, *delim; int ipv6; + bool ipversion_set = false; if (*cur != '@') { if ((delim = strchr(cur, '@')) == NULL) @@ -955,6 +956,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) cur++; if (*cur != '/') { + ipversion_set = true; if ((delim = strchr(cur, '/')) == NULL) goto parse_failed; *delim = 0; @@ -997,7 +999,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) ipv6 = netpoll_parse_ip_addr(cur, &np->remote_ip); if (ipv6 < 0) goto parse_failed; - else if (np->ipv6 != (bool)ipv6) + else if (ipversion_set && np->ipv6 != (bool)ipv6) goto parse_failed; else np->ipv6 = (bool)ipv6; |