devices: fix default ethernet connection code

Creation of default wired connections got broken by an incomplete
rebase of dcbw/internal-device-factories after danw/libnm-props
landed.

https://bugzilla.gnome.org/show_bug.cgi?id=737273
This commit is contained in:
Dan Winship 2014-09-24 13:15:42 -04:00
parent 687f319201
commit 94c3f1f70f

View file

@ -1473,7 +1473,6 @@ new_default_connection (NMDevice *self)
NMSetting *setting;
const char *hw_address;
char *defname, *uuid;
GByteArray *mac;
if (!nm_config_get_ethernet_can_auto_default (nm_config_get (), self))
return NULL;
@ -1501,12 +1500,9 @@ new_default_connection (NMDevice *self)
/* Lock the connection to the device */
setting = nm_setting_wired_new ();
g_object_set (setting, NM_SETTING_WIRED_MAC_ADDRESS, hw_address, NULL);
nm_connection_add_setting (connection, setting);
mac = nm_utils_hwaddr_atoba (hw_address, ETH_ALEN);
g_object_set (setting, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL);
g_byte_array_unref (mac);
return connection;
}