mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 11:08:03 +02:00
linux-platform: treat gadget devices as ethernet devices
Also, don't manage them by default. Whatver created it should take care of
management.
(cherry picked from commit c1cf3c25c8)
This commit is contained in:
parent
bd27102277
commit
b95c88284d
2 changed files with 18 additions and 7 deletions
|
|
@ -26,4 +26,9 @@ ATTR{address}=="00:1c:42:*", ENV{INTERFACE}=="vnic[0-9]*", ENV{NM_UNMANAGED}="1"
|
|||
# in another net namespace and managed by libvirt, Docker or the like.
|
||||
ENV{ID_NET_DRIVER}=="veth", ENV{NM_UNMANAGED}="1"
|
||||
|
||||
# USB gadget device. Unmanage by default, since whatever created it
|
||||
# might want to set it up itself (e.g. activate an ipv4.method=shared
|
||||
# connection).
|
||||
ENV{DEVTYPE}=="gadget", ENV{NM_UNMANAGED}="1"
|
||||
|
||||
LABEL="nm_unmanaged_end"
|
||||
|
|
|
|||
|
|
@ -989,13 +989,19 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, gboolean *c
|
|||
if (wifi_utils_is_wifi (ifname, sysfs_path))
|
||||
return NM_LINK_TYPE_WIFI;
|
||||
|
||||
/* Standard wired ethernet interfaces don't report an rtnl_link_type, so
|
||||
* only allow fallback to Ethernet if no type is given. This should
|
||||
* prevent future virtual network drivers from being treated as Ethernet
|
||||
* when they should be Generic instead.
|
||||
*/
|
||||
if (arptype == ARPHRD_ETHER && !rtnl_type && !devtype)
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
if (arptype == ARPHRD_ETHER) {
|
||||
/* Standard wired ethernet interfaces don't report an rtnl_link_type, so
|
||||
* only allow fallback to Ethernet if no type is given. This should
|
||||
* prevent future virtual network drivers from being treated as Ethernet
|
||||
* when they should be Generic instead.
|
||||
*/
|
||||
if (!rtnl_type && !devtype)
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
/* The USB gadget interfaces behave and look like ordinary ethernet devices
|
||||
* aside from the DEVTYPE. */
|
||||
if (!g_strcmp0 (devtype, "gadget"))
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
}
|
||||
}
|
||||
|
||||
return NM_LINK_TYPE_UNKNOWN;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue