GNOME Bugzilla – Bug 696722
nm-settings.c::have_connection_for_device() doesn't take interface name locking into account
Last modified: 2013-04-11 18:57:00 UTC
Noticed this while reviewing danw/config; but I don't think this function looks at nm_setting_connection_get_interface_name() and thus it will ignore any connection that's locked to a device via interface name, which could cause a default DHCP connection for a device that has an interface-locked connection.
Created attachment 241256 [details] [review] settings: consider :interface-name in default wired connection matching The code to check if an ethernet device had a matching connection was not taking NMSettingConnection:interface-name into account, meaning it might think a device had a matching connection when that connection actually only matched a different device. Fix this by calling nm_setting_connection_get_interface_name() rather than nm_connection_get_virtual_iface_name() (which would always be NULL for ethernet connections anyway). Also, simplify the code a bit.
Review of attachment 241256 [details] [review]: Looks good.
Attachment 241256 [details] pushed as f1d31e3 - settings: consider :interface-name in default wired connection matching