about summary refs log tree commit diff
path: root/src/core/devices/nm-device-macsec.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2024-02-22 17:22:03 +0100
committerMichael Biebl <biebl@debian.org>2024-02-22 17:22:03 +0100
commitee7b97d8af11fb1c2cbcd4df0deb298ff906fa8b (patch)
treeb0978e9f3ed4e2e9b727844e57637783ca47a8ef /src/core/devices/nm-device-macsec.c
parentd8ad0e3c21e712308cf070716acc421adfabd7d3 (diff)
parentbba2e4b4de668db525cbfdfc35292e5a0b51671a (diff)
Update upstream source from tag 'upstream/1.46.0'
Update to upstream version '1.46.0'
with Debian dir 8c30a24f4e6f4278d9943aef82e6ae63c4528df5
Diffstat (limited to 'src/core/devices/nm-device-macsec.c')
-rw-r--r--src/core/devices/nm-device-macsec.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core/devices/nm-device-macsec.c b/src/core/devices/nm-device-macsec.c
index 130708bb..32fab5be 100644
--- a/src/core/devices/nm-device-macsec.c
+++ b/src/core/devices/nm-device-macsec.c
@@ -10,6 +10,7 @@
 #include <linux/if_ether.h>
 
 #include "nm-act-request.h"
+#include "nm-config.h"
 #include "nm-device-private.h"
 #include "libnm-platform/nm-platform.h"
 #include "nm-device-factory.h"
@@ -190,6 +191,7 @@ build_supplicant_config(NMDeviceMacsec *self, GError **error)
     NMConnection                       *connection;
     const char                         *con_uuid;
     guint32                             mtu;
+    int                                 offload;
 
     connection = nm_device_get_applied_connection(NM_DEVICE(self));
 
@@ -205,7 +207,20 @@ build_supplicant_config(NMDeviceMacsec *self, GError **error)
 
     g_return_val_if_fail(s_macsec, NULL);
 
-    if (!nm_supplicant_config_add_setting_macsec(config, s_macsec, error)) {
+    offload = nm_setting_macsec_get_offload(s_macsec);
+    if (offload == NM_SETTING_MACSEC_OFFLOAD_DEFAULT) {
+        offload = nm_config_data_get_connection_default_int64(NM_CONFIG_GET_DATA,
+                                                              NM_CON_DEFAULT("macsec.offload"),
+                                                              NM_DEVICE(self),
+                                                              NM_SETTING_MACSEC_OFFLOAD_OFF,
+                                                              NM_SETTING_MACSEC_OFFLOAD_MAC,
+                                                              NM_SETTING_MACSEC_OFFLOAD_OFF);
+    }
+
+    if (!nm_supplicant_config_add_setting_macsec(config,
+                                                 s_macsec,
+                                                 (NMSettingMacsecOffload) offload,
+                                                 error)) {
         g_prefix_error(error, "macsec-setting: ");
         return NULL;
     }