Skip to content

Commit 00fe11b

Browse files
qsndavem330
authored andcommitted
netpoll: fix netconsole IPv6 setup
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>
1 parent 440b87e commit 00fe11b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/core/netpoll.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
948948
{
949949
char *cur=opt, *delim;
950950
int ipv6;
951+
bool ipversion_set = false;
951952

952953
if (*cur != '@') {
953954
if ((delim = strchr(cur, '@')) == NULL)
@@ -960,6 +961,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
960961
cur++;
961962

962963
if (*cur != '/') {
964+
ipversion_set = true;
963965
if ((delim = strchr(cur, '/')) == NULL)
964966
goto parse_failed;
965967
*delim = 0;
@@ -1002,7 +1004,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
10021004
ipv6 = netpoll_parse_ip_addr(cur, &np->remote_ip);
10031005
if (ipv6 < 0)
10041006
goto parse_failed;
1005-
else if (np->ipv6 != (bool)ipv6)
1007+
else if (ipversion_set && np->ipv6 != (bool)ipv6)
10061008
goto parse_failed;
10071009
else
10081010
np->ipv6 = (bool)ipv6;

0 commit comments

Comments
 (0)