GNOME Bugzilla – Bug 743209
[PATCH] platform: rework link type detection for better fallback
Last modified: 2015-05-01 20:30:39 UTC
See "Revert "wireless: Support of IFLA_INFO_KIND rtnl attribute"" http://www.spinics.net/lists/linux-wireless/msg132219.html The reverted kernel patch caused rtnl_link_get_type() to return "wlan" for WiFi devices. Since NM depends on this function returning NULL for WiFi devices so that it goes on to check udev's DEVTYPE attribute, the kernel patch caused WiFi devices to show up as Generic ones instead. That's wrong, and NM should be able to more easily handle changes in the kernel drivers from NULL to a more descriptive rtnl_link_get_type() return, since that's the kernel trend. What NM should be doing here is to fall back to other detection schemes (including udev) if the type is NULL *or* unrecognized. Make that happen and clean things up to use a table instead of
Created attachment 294926 [details] [review] 0001-platform-rework-link-type-detection-for-better-fallb.patch
Another instance of this is openvswitch, which for 3.17+ now reports a link type of 'openvswitch'. But NM also depends on rtnl_link_get_type() being NULL for OVS devices, so that it continues on to check ethtool. There is overall effect though, since OVS devices are still NMDeviceGeneric.
Created attachment 294927 [details] [review] 0002-platform-detect-openvswitch-interfaces-more-quickly-.patch
Comment on attachment 294926 [details] [review] 0001-platform-rework-link-type-detection-for-better-fallb.patch >- if (arptype == ARPHRD_ETHER) >+ /* Standard wired ethernet interfaces don't report an rtnl_link_type Is that always going to be a safe assumption? > link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, const char **out_name) if we're going to rewrite this stuff anyway it might be nice to fix the FIXME in link_is_software() (which ought to be calling link_extract_type(), but can't because for tun/tap, link_extract_type() calls nm_platform_tun_get_properties(), which calls link_get(), which calls link_is_announceable(), which calls link_is_software()). (The fix there might be to stop distinguishing tun and tap at the NMPlatformLinkType level, but still distinguish them at the NMDeviceTun level.)
Comment on attachment 294927 [details] [review] 0002-platform-detect-openvswitch-interfaces-more-quickly-.patch >- { "dummy", NM_LINK_TYPE_DUMMY }, >+ { "dummy", NM_LINK_TYPE_DUMMY }, just use the wider column width in the original patch :)
Rebased and pushed to dcbw/bgo747628-platform-udev-excise
Merged to master as part of dcbw/bgo747628-platform-udev-excise 2d527b30ffb57e458f8880e8cf4f5801d648ffeb