about summary refs log tree commit diff
path: root/src/libnm-core-impl/nm-setting.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2024-05-05 00:07:30 +0200
committerMichael Biebl <biebl@debian.org>2024-05-05 00:07:30 +0200
commit34bb501be08aa2b313d88e67d6e0a7e0a3f9cfa6 (patch)
tree4e6220877828be4c6f261de09ec0cb2d80e32389 /src/libnm-core-impl/nm-setting.c
parentbba2e4b4de668db525cbfdfc35292e5a0b51671a (diff)
New upstream version 1.47.90 upstream/1.47.90
Diffstat (limited to 'src/libnm-core-impl/nm-setting.c')
-rw-r--r--src/libnm-core-impl/nm-setting.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c
index 8bc7b4bf..bbaa6fcd 100644
--- a/src/libnm-core-impl/nm-setting.c
+++ b/src/libnm-core-impl/nm-setting.c
@@ -8,6 +8,8 @@
 
 #include "nm-setting.h"
 
+#include <linux/if_ether.h>
+
 #include "libnm-core-intern/nm-core-internal.h"
 #include "libnm-glib-aux/nm-ref-string.h"
 #include "libnm-glib-aux/nm-secret-utils.h"
@@ -739,10 +741,29 @@ _property_direct_set_strv(const NMSettInfoSetting  *sett_info,
     if (!property_info->direct_strv_preserve_empty && strv && !strv[0])
         strv = NULL;
 
-    if (nm_strvarray_equal_strv(p_val->arr, strv, -1))
-        return FALSE;
+    if (property_info->direct_set_strv_normalize_hwaddr) {
+        gs_unref_array GArray *arr = NULL;
+        if (strv) {
+            nm_strvarray_ensure(&arr);
+
+            for (; strv[0]; strv++) {
+                nm_strvarray_add_take(arr,
+                                      _nm_utils_hwaddr_canonical_or_invalid(strv[0], ETH_ALEN));
+            }
+        }
+
+        if (nm_strvarray_equal(p_val->arr, arr))
+            return FALSE;
 
+        NM_SWAP(&p_val->arr, &arr);
+        return TRUE;
+    }
+
+    if (nm_strvarray_equal_strv(p_val->arr, strv, -1)) {
+        return FALSE;
+    }
     nm_strvarray_set_strv_full(&p_val->arr, strv, property_info->direct_strv_preserve_empty);
+
     return TRUE;
 }
 
@@ -844,7 +865,7 @@ _nm_setting_property_get_property_direct(GObject    *object,
             value,
             nm_strvarray_get_strv_full_dup(p_val->arr,
                                            NULL,
-                                           FALSE,
+                                           property_info->direct_strv_not_null,
                                            property_info->direct_strv_preserve_empty));
         return;
     }
@@ -2711,7 +2732,9 @@ _nm_setting_property_compare_fcn_direct(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_
                         _nm_setting_property_to_dbus_fcn_direct_mac_address,
                         _nm_setting_connection_controller_to_dbus,
                         _nm_setting_connection_port_type_to_dbus,
-                        _nm_setting_connection_autoconnect_ports_to_dbus));
+                        _nm_setting_connection_autoconnect_ports_to_dbus,
+                        _nm_setting_wireless_mac_denylist_to_dbus,
+                        _nm_setting_wired_mac_denylist_to_dbus));
 
     if (!property_info->param_spec)
         return nm_assert_unreachable_val(NM_TERNARY_DEFAULT);