From: Dominique MARTINET <dominique.martinet@atmark-techno.com>
To: Oliver Neukum <oneukum@suse.com>
Cc: edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, Greg Thelen <gthelen@google.com>,
John Sperbeck <jsperbeck@google.com>,
stable@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH net] net: usb: usbnet: fix name regression
Date: Mon, 2 Dec 2024 12:50:15 +0900 [thread overview]
Message-ID: <Z00udyMgW6XnAw6h@atmark-techno.com> (raw)
In-Reply-To: <20241017071849.389636-1-oneukum@suse.com>
Hi,
Oliver Neukum wrote on Thu, Oct 17, 2024 at 09:18:37AM +0200:
> The fix for MAC addresses broke detection of the naming convention
> because it gave network devices no random MAC before bind()
> was called. This means that the check for the local assignment bit
> was always negative as the address was zeroed from allocation,
> instead of from overwriting the MAC with a unique hardware address.
So we hit the exact inverse problem with this patch: our device ships an
LTE modem which exposes a cdc-ethernet interface that had always been
named usb0, and with this patch it started being named eth1, breaking
too many hardcoded things expecting the name to be usb0 and making our
devices unable to connect to the internet after updating the kernel.
Long term we'll probably add an udev rule or something to make the name
explicit in userspace and not risk this happening again, but perhaps
there's a better way to keep the old behavior?
(In particular this hit all stable kernels last month so I'm sure we
won't be the only ones getting annoyed with this... Perhaps reverting
both patches for stable branches might make sense if no better way
forward is found -- I've added stable@ in cc for heads up/opinions)
> +++ b/drivers/net/usb/usbnet.c
> @@ -1767,7 +1767,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
> // can rename the link if it knows better.
> if ((dev->driver_info->flags & FLAG_ETHER) != 0 &&
> ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 ||
> - (net->dev_addr [0] & 0x02) == 0))
> + /* somebody touched it*/
> + !is_zero_ether_addr(net->dev_addr)))
... or actually now I'm looking at it again, perhaps is the check just
backwards, or am I getting this wrong?
previous check was rename if (mac[0] & 0x2 == 0), which reads to me as
"nobody set the 2nd bit"
new check now renames if !is_zero, so renames if it was set, which is
the opposite?...
> strscpy(net->name, "eth%d", sizeof(net->name));
> /* WLAN devices should always be named "wlan%d" */
Thanks,
--
Dominique Martinet
next prev parent reply other threads:[~2024-12-02 3:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 7:18 [PATCH net] net: usb: usbnet: fix name regression Oliver Neukum
2024-10-17 16:11 ` Simon Horman
2024-10-22 11:23 ` Paolo Abeni
2024-10-22 11:30 ` patchwork-bot+netdevbpf
2024-12-02 3:50 ` Dominique MARTINET [this message]
2024-12-02 6:29 ` Greg Kroah-Hartman
2024-12-02 8:24 ` Dominique MARTINET
2024-12-02 8:17 ` David Laight
2024-12-02 8:36 ` 'Dominique MARTINET'
2024-12-02 14:56 ` Jakub Kicinski
2024-12-02 23:39 ` 'Dominique MARTINET'
2024-12-03 0:26 ` Jakub Kicinski
2024-12-03 1:18 ` 'Dominique MARTINET'
2024-12-03 2:29 ` Jakub Kicinski
2024-12-03 13:14 ` 'Dominique MARTINET'
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=Z00udyMgW6XnAw6h@atmark-techno.com \
--to=dominique.martinet@atmark-techno.com \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=gthelen@google.com \
--cc=jsperbeck@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=pabeni@redhat.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).