[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <rsvfhrzqn4zwb2g5zrr6t3ige6lic73xtamzhmcr5flkwaor4a@x4s3sy6uqrcx>
Date: Wed, 23 Jul 2025 08:06:45 -0700
From: Breno Leitao <leitao@...ian.org>
To: Simon Horman <horms@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...a.com
Subject: Re: [PATCH net-next v2 4/5] netconsole: use netpoll_parse_ip_addr in
local_ip_store
Hello Simon
On Wed, Jul 23, 2025 at 03:54:00PM +0100, Simon Horman wrote:
> > @@ -759,23 +760,10 @@ static ssize_t local_ip_store(struct config_item *item, const char *buf,
> > goto out_unlock;
> > }
> >
> > - if (strnchr(buf, count, ':')) {
> > - const char *end;
> > -
> > - if (in6_pton(buf, count, nt->np.local_ip.in6.s6_addr, -1, &end) > 0) {
> > - if (*end && *end != '\n') {
> > - pr_err("invalid IPv6 address at: <%c>\n", *end);
> > - goto out_unlock;
> > - }
> > - nt->np.ipv6 = true;
> > - } else
> > - goto out_unlock;
> > - } else {
> > - if (!nt->np.ipv6)
> > - nt->np.local_ip.ip = in_aton(buf);
> > - else
> > - goto out_unlock;
> > - }
> > + ipv6 = netpoll_parse_ip_addr(buf, &nt->np.local_ip);
> > + if (ipv6 == -1)
> > + goto out_unlock;
> > + nt->np.ipv6 = ipv6;
>
> I don't think this needs to block progress.
> And if you disagree that is fine too.
> But I would have expressed this as:
>
> nt->np.ipv6 = !!ipv6;
>
> Because nt->np.ipv6 is a bool and ipv6 is an int.
>
> Likewise for patch 5/5.
Agree with the suggestion. I will update the patchset with your
suggestion.
Thank you very much for your review, again!
--breno
Powered by blists - more mailing lists