Skip to content

Commit

Permalink
net/ipv4/ipconfig: Rejoin broken lines in console output
Browse files Browse the repository at this point in the history
Commit 09605cc ("net ipv4: use preferred log methods") replaced
a few calls of pr_cont() after a console print without a trailing
newline by pr_info(), causing lines to be split during IP
autoconfiguration, like:

    .
    ,
     OK
    IP-Config: Got DHCP answer from 192.168.97.254,
    my address is 192.168.97.44

Convert these back to using pr_cont(), so it prints again:

    ., OK
    IP-Config: Got DHCP answer from 192.168.97.254, my address is 192.168.97.44

Absorb the printing of "my address ..." into the previous call to
pr_info(), as there's no reason to use a continuation there.

Convert one more pr_info() to print nameservers while we're at it.

Fixes: 09605cc ("net ipv4: use preferred log methods")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Geert Uytterhoeven authored and David S. Miller committed Nov 24, 2015
1 parent 85beabf commit 6c1c36b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions net/ipv4/ipconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,21 +1239,21 @@ static int __init ic_dynamic(void)
(ic_proto_enabled & IC_USE_DHCP) &&
ic_dhcp_msgtype != DHCPACK) {
ic_got_reply = 0;
pr_notice(",");
pr_cont(",");
continue;
}
#endif /* IPCONFIG_DHCP */

if (ic_got_reply) {
pr_notice(" OK\n");
pr_cont(" OK\n");
break;
}

if ((d = d->next))
continue;

if (! --retries) {
pr_notice(" timed out!\n");
pr_cont(" timed out!\n");
break;
}

Expand All @@ -1263,7 +1263,7 @@ static int __init ic_dynamic(void)
if (timeout > CONF_TIMEOUT_MAX)
timeout = CONF_TIMEOUT_MAX;

pr_notice(".");
pr_cont(".");
}

#ifdef IPCONFIG_BOOTP
Expand All @@ -1280,11 +1280,10 @@ static int __init ic_dynamic(void)
return -1;
}

pr_info("IP-Config: Got %s answer from %pI4, ",
pr_info("IP-Config: Got %s answer from %pI4, my address is %pI4\n",
((ic_got_reply & IC_RARP) ? "RARP"
: (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
&ic_addrservaddr);
pr_info("my address is %pI4\n", &ic_myaddr);
&ic_addrservaddr, &ic_myaddr);

return 0;
}
Expand Down Expand Up @@ -1527,14 +1526,14 @@ static int __init ip_auto_config(void)
pr_cont(", mtu=%d", ic_dev_mtu);
for (i = 0; i < CONF_NAMESERVERS_MAX; i++)
if (ic_nameservers[i] != NONE) {
pr_info(" nameserver%u=%pI4",
pr_cont(" nameserver%u=%pI4",
i, &ic_nameservers[i]);
break;
}
for (i++; i < CONF_NAMESERVERS_MAX; i++)
if (ic_nameservers[i] != NONE)
pr_info(", nameserver%u=%pI4", i, &ic_nameservers[i]);
pr_info("\n");
pr_cont(", nameserver%u=%pI4", i, &ic_nameservers[i]);
pr_cont("\n");
#endif /* !SILENT */

return 0;
Expand Down

0 comments on commit 6c1c36b

Please sign in to comment.