core: suppress missing MAC address warning during connection matching
One of the connetions may not have a MAC address, so don't expect one.
This commit is contained in:
@@ -798,7 +798,7 @@ check_connection_mac_address (NMConnection *orig,
|
|||||||
GHashTable *settings)
|
GHashTable *settings)
|
||||||
{
|
{
|
||||||
GHashTable *props;
|
GHashTable *props;
|
||||||
const GByteArray *orig_mac, *cand_mac;
|
const GByteArray *orig_mac = NULL, *cand_mac = NULL;
|
||||||
NMSettingWired *s_wired_orig, *s_wired_cand;
|
NMSettingWired *s_wired_orig, *s_wired_cand;
|
||||||
|
|
||||||
props = check_property_in_hash (settings,
|
props = check_property_in_hash (settings,
|
||||||
@@ -809,9 +809,12 @@ check_connection_mac_address (NMConnection *orig,
|
|||||||
|
|
||||||
/* If one of the MAC addresses is NULL, we accept that connection */
|
/* If one of the MAC addresses is NULL, we accept that connection */
|
||||||
s_wired_orig = nm_connection_get_setting_wired (orig);
|
s_wired_orig = nm_connection_get_setting_wired (orig);
|
||||||
|
if (s_wired_orig)
|
||||||
|
orig_mac = nm_setting_wired_get_mac_address (s_wired_orig);
|
||||||
|
|
||||||
s_wired_cand = nm_connection_get_setting_wired (candidate);
|
s_wired_cand = nm_connection_get_setting_wired (candidate);
|
||||||
orig_mac = nm_setting_wired_get_mac_address (s_wired_orig);
|
if (s_wired_cand)
|
||||||
cand_mac = nm_setting_wired_get_mac_address (s_wired_cand);
|
cand_mac = nm_setting_wired_get_mac_address (s_wired_cand);
|
||||||
|
|
||||||
if (!orig_mac || !cand_mac) {
|
if (!orig_mac || !cand_mac) {
|
||||||
remove_from_hash (settings, props,
|
remove_from_hash (settings, props,
|
||||||
|
Reference in New Issue
Block a user