From e5ccc30e3c0ba0c55d4a5a77c72ec501e74bc201 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 6 Jun 2014 15:49:52 -0500 Subject: [PATCH] core: suppress missing MAC address warning during connection matching One of the connetions may not have a MAC address, so don't expect one. --- src/NetworkManagerUtils.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index d300d39210..0aaa344f91 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -798,7 +798,7 @@ check_connection_mac_address (NMConnection *orig, GHashTable *settings) { GHashTable *props; - const GByteArray *orig_mac, *cand_mac; + const GByteArray *orig_mac = NULL, *cand_mac = NULL; NMSettingWired *s_wired_orig, *s_wired_cand; 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 */ 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); - orig_mac = nm_setting_wired_get_mac_address (s_wired_orig); - cand_mac = nm_setting_wired_get_mac_address (s_wired_cand); + if (s_wired_cand) + cand_mac = nm_setting_wired_get_mac_address (s_wired_cand); if (!orig_mac || !cand_mac) { remove_from_hash (settings, props,