diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-05-07 11:51:11 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-05-28 15:03:20 +0200 |
commit | 27eb2b2f9773415ff51574d3e4974af7cb71b7ff (patch) | |
tree | ab43da98754dc64e5d12d218b5fd150749487f91 | |
parent | 77471b1d777de28435d6e486ee31a2a4dedb5275 (diff) | |
download | NetworkManager-27eb2b2f9773415ff51574d3e4974af7cb71b7ff.tar.gz |
infiniband: remove the MAC address check from complete_connection()
nm_device_complete_connection() now calls check_connection_compatible()
which has a redundant check.
-rw-r--r-- | src/devices/nm-device-infiniband.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index 4db7d8a723..d4bbc163d9 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -161,8 +161,6 @@ complete_connection (NMDevice *device, GError **error) { NMSettingInfiniband *s_infiniband; - const char *setting_mac; - const char *hw_address; nm_utils_complete_generic (nm_device_get_platform (device), connection, @@ -179,21 +177,11 @@ complete_connection (NMDevice *device, nm_connection_add_setting (connection, NM_SETTING (s_infiniband)); } - setting_mac = nm_setting_infiniband_get_mac_address (s_infiniband); - hw_address = nm_device_get_permanent_hw_address (device); - if (setting_mac) { - /* Make sure the setting MAC (if any) matches the device's MAC */ - if (!nm_utils_hwaddr_matches (setting_mac, -1, hw_address, -1)) { - g_set_error_literal (error, - NM_CONNECTION_ERROR, - NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("connection does not match device")); - g_prefix_error (error, "%s.%s: ", NM_SETTING_INFINIBAND_SETTING_NAME, NM_SETTING_INFINIBAND_MAC_ADDRESS); - return FALSE; - } - } else { + if (!nm_setting_infiniband_get_mac_address (s_infiniband)) { /* Lock the connection to this device by default */ - g_object_set (G_OBJECT (s_infiniband), NM_SETTING_INFINIBAND_MAC_ADDRESS, hw_address, NULL); + g_object_set (G_OBJECT (s_infiniband), + NM_SETTING_INFINIBAND_MAC_ADDRESS, nm_device_get_permanent_hw_address (device), + NULL); } if (!nm_setting_infiniband_get_transport_mode (s_infiniband)) |