After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739889 - spurious "failed to look up interface index" warning
spurious "failed to look up interface index" warning
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-1.0
 
 
Reported: 2014-11-10 15:17 UTC by Dan Winship
Modified: 2014-12-01 11:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: fix a spurious warning with non-kernel network devices (6.93 KB, patch)
2014-11-10 15:17 UTC, Dan Winship
none Details | Review
core: fix a spurious warning with non-kernel network devices (4.75 KB, patch)
2014-11-13 22:18 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2014-11-10 15:17:01 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.
Comment 1 Dan Winship 2014-11-10 15:17:21 UTC
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)
Comment 2 Dan Williams 2014-11-13 19:50:46 UTC
Looks OK to me.
Comment 3 Dan Williams 2014-11-13 19:54:34 UTC
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.
Comment 4 Thomas Haller 2014-11-13 20:05:52 UTC
LGTM
Comment 5 Dan Winship 2014-11-13 22:18:27 UTC
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?
Comment 6 Dan Williams 2014-11-14 15:11:57 UTC
LGTM
Comment 7 Thomas Haller 2014-11-14 15:30:36 UTC
You dropped now the:

(Also, belatedly add NM_DEVICE_CAP_IS_SOFTWARE to
introspection/nm-device.xml)

part.


Rest LGTM
Comment 8 Dan Winship 2014-11-14 15:50:03 UTC
(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.
Comment 9 Thomas Haller 2014-11-14 16:10:59 UTC
breaks make-check:


(gdb) bt
  • #0 __GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 56
  • #1 __GI_abort
    at abort.c line 89
  • #2 _g_log_abort
    at gmessages.c line 255
  • #3 g_assertion_message
  • #4 g_assertion_message_expr
    at gtestutils.c line 2293
  • #5 reset_error
    at ../../src/platform/nm-platform.c line 190
  • #6 nm_platform_link_get_ifindex
    at ../../src/platform/nm-platform.c line 577
  • #7 set_property
    at ../../src/devices/nm-device.c line 8050
  • #8 object_set_property
    at gobject.c line 1366
  • #9 g_object_constructor
    at gobject.c line 2042
  • #10 g_object_new_with_custom_constructor
    at gobject.c line 1665
  • #11 g_object_new_internal
    at gobject.c line 1744
  • #12 g_object_new_valist
    at gobject.c line 2002
  • #13 g_object_new
    at gobject.c line 1559
  • #14 nm_test_device_new
    at ../../../../src/tests/config/nm-test-device.c line 86
  • #15 test_config_no_auto_default
    at ../../../../src/tests/config/test-config.c line 183
  • #16 test_case_run
    at gtestutils.c line 2067
  • #17 g_test_run_suite_internal
    at gtestutils.c line 2127
  • #18 g_test_run_suite_internal
    at gtestutils.c line 2138
  • #19 g_test_run_suite
    at gtestutils.c line 2189
  • #20 g_test_run
    at gtestutils.c line 1508
  • #21 main
    at ../../../../src/tests/config/test-config.c line 303

Comment 10 Dan Winship 2014-11-14 20:38:31 UTC
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