mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-15 02:10:32 +01:00
platform: in _linktype_get_type() check for devtype before the interface name
I think the devtype should be checked first, before the interface name. Checking by name seems really very hacky, move that last.
This commit is contained in:
parent
061cc60fda
commit
46fdf8a40e
1 changed files with 11 additions and 9 deletions
|
|
@ -1285,6 +1285,17 @@ _linktype_get_type(NMPlatform *platform,
|
|||
return NM_LINK_TYPE_WIFI;
|
||||
}
|
||||
|
||||
if (arptype == ARPHRD_ETHER) {
|
||||
/* The USB gadget interfaces behave and look like ordinary ethernet devices
|
||||
* aside from the DEVTYPE. */
|
||||
if (nm_streq0(devtype, "gadget"))
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
|
||||
/* Distributed Switch Architecture switch chips */
|
||||
if (nm_streq0(devtype, "dsa"))
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
}
|
||||
|
||||
/* Misc non-upstream WWAN drivers. rmnet is Qualcomm's proprietary
|
||||
* modem interface, ccmni is MediaTek's. FIXME: these drivers should
|
||||
* really set devtype=WWAN.
|
||||
|
|
@ -1312,15 +1323,6 @@ _linktype_get_type(NMPlatform *platform,
|
|||
*/
|
||||
if (!kind && !devtype)
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
|
||||
/* The USB gadget interfaces behave and look like ordinary ethernet devices
|
||||
* aside from the DEVTYPE. */
|
||||
if (nm_streq0(devtype, "gadget"))
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
|
||||
/* Distributed Switch Architecture switch chips */
|
||||
if (nm_streq0(devtype, "dsa"))
|
||||
return NM_LINK_TYPE_ETHERNET;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue