From: Jakub Kicinski <kuba@kernel.org>
To: Florent Fourcot <florent.fourcot@wifirst.fr>
Cc: netdev@vger.kernel.org, Brian Baboch <brian.baboch@wifirst.fr>
Subject: Re: [PATCH net-next] rtnetlink: enable alt_ifname for setlink/newlink
Date: Thu, 31 Mar 2022 20:54:10 -0700 [thread overview]
Message-ID: <20220331205410.392efbf0@kernel.org> (raw)
In-Reply-To: <20220331123728.7267-1-florent.fourcot@wifirst.fr>
On Thu, 31 Mar 2022 14:37:28 +0200 Florent Fourcot wrote:
> buffer is always valid when called by setlink/newlink,
> but contains only empty string when IFLA_IFNAME is not given. So
> IFLA_ALT_IFNAME is always ignored
>
> Fixes: 76c9ac0ee878 ("net: rtnetlink: add possibility to use alternative names as message handle")
Again, you most definitely need to CC the author of the code under
Fixes, they may have some context we don't.
Since this is a fix the subject tag should be [PATCH net].
> Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
> Signed-off-by: Brian Baboch <brian.baboch@wifirst.fr>
> ---
> net/core/rtnetlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 3313419bbcba..613065a53b34 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -2979,7 +2979,7 @@ static struct net_device *rtnl_dev_get(struct net *net,
> {
> char buffer[ALTIFNAMSIZ];
>
> - if (!ifname) {
> + if (!ifname || !ifname[0]) {
Unless I'm missing something this function is loading a footgun to
save copying 16B twice. I'd remove the ifname argument, it's always
populated from ifname_attr by the callers AFAICT.
prev parent reply other threads:[~2022-04-01 3:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-31 12:37 [PATCH net-next] rtnetlink: enable alt_ifname for setlink/newlink Florent Fourcot
2022-04-01 3:54 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220331205410.392efbf0@kernel.org \
--to=kuba@kernel.org \
--cc=brian.baboch@wifirst.fr \
--cc=florent.fourcot@wifirst.fr \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.