GNOME Bugzilla – Bug 701744
[review] dcbw/bt-hwaddr: assertion `ifindex > 0' failed when creating PAN connection
Last modified: 2013-07-22 20:55:00 UTC
Running NM from git master, bluetoothd from bluez 4.101 with 666dd92b683971aaf74398a4c1639f0a033853b2 backported, and gnome-bluetooth/gnome-control-center 3.8.0 I have paired a PAN device (Nexus 4) with bluetooth-wizard. Then at the end of the pairing process in the wizard, or from gnome-control-center's bluetooth panel, there is a checkbox to "use [my] mobile phone as a network device (PAN/NAP). If I enable the checkbox, NM creates the connection but asserts (twice) like this: NetworkManager[23563]: nm_device_update_hw_address: assertion `ifindex > 0' failed Program received signal SIGTRAP, Trace/breakpoint trap. g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffca98) at gmessages.c:981 981 g_private_set (&g_log_depth, GUINT_TO_POINTER (depth)); (gdb) bt
+ Trace 232019
Continuing. NetworkManager[23563]: <info> (10:68:3F:BA:C6:16): device state change: unavailable -> disconnected (reason 'none') [20 30 0]
can you try the danw/hwlen branch (which I've just now updated) and if that fixes it, mark this a dup of 701675?
Sure will do that soon.
I also get this with that branch. Let me know if you need any further info.
NMDeviceBt knows the HW_ADDR at construct time, and sends that to g_object_new() as a property. After that, it shouldn't ever change, and calling nm_device_update_hw_address() is pretty pointless. Unfortunately nm_device_update_hw_address() assumes that if the device subclass implements get_hw_address_length that it'll have a valid ifindex, which won't be the case for the Bluetooth device as its not actually a netdevice and thus has no ifindex. Yet it does have a hardware address, and it's already been set. (NMDeviceAdsl gets around this because it doesn't provide an HW_ADDR unless a 'nas' interface is used, which is a netdev, and which does have an ifindex) Some solutions: 1) some kind of flag/property/function indicating that the address shouldn't ever be changed? 2) add an "out" argument to the get_hw_address_length() class method that indicates that the address shouldn't be changed? 3) just return if we don't have a valid ifindex I think #2 is probably the easiest/cleanest, because #3 might mask some actual errors we're interested in. Pushed #2 as dcbw/bt-hwaddr, please review?
Pushed to git master after review by danw.