GNOME Bugzilla – Bug 739889
spurious "failed to look up interface index" warning
Last modified: 2014-12-01 11:05:28 UTC
When attaching a non-kernel-backed device (other than Bluetooth), NM prints a spurious warning: NetworkManager[864]: <warn> (cxacru0): failed to look up interface index NetworkManager[864]: <warn> (ttyUSB0): failed to look up interface index I fixed this by adding NM_DEVICE_CAP_IS_NON_KERNEL, but this required some further reorganization, because priv->capabilities isn't set yet when construct-time properties are being set, and its initialization can't be moved earlier, since NMDeviceEthernet's get_generic_capabilities() needs priv->ifindex to have been set already. So I just moved the warning until later.
Created attachment 290351 [details] [review] core: fix a spurious warning with non-kernel network devices NMDevice was warning about not being able to set ifindex even on devices that we know don't have an ifindex. (Also, belatedly add NM_DEVICE_CAP_IS_SOFTWARE to introspection/nm-device.xml)
Looks OK to me.
Though, should that flag really be public? The issue is that non-kernel interfaces sort-of become kernel interfaces when they get IP config and then 'IpInterface' gets set to the right value. I'm not sure really, I can see an argument that clients would want to know if the NMDevice is not really a kernel device, but then we've never really had requests for that kind of thing before so it makes me thing it's not something that clients really care about.
LGTM
Created attachment 290669 [details] [review] core: fix a spurious warning with non-kernel network devices OK, this still uses priv->capabilities, but makes it an internal flag. Better?
You dropped now the: (Also, belatedly add NM_DEVICE_CAP_IS_SOFTWARE to introspection/nm-device.xml) part. Rest LGTM
(In reply to comment #7) > You dropped now the: > > (Also, belatedly add NM_DEVICE_CAP_IS_SOFTWARE to > introspection/nm-device.xml) > > part. Yeah, since it didn't really go with this any more. I moved it to another general cleanup branch which I'll submit later.
breaks make-check: (gdb) bt
+ Trace 234331
pushed with a fix to NMTestDevice to fix "make check" Attachment 290669 [details] pushed as d1faee9 - core: fix a spurious warning with non-kernel network devices