summary refs log tree commit diff
path: root/src/core/devices/nm-device-macsec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/devices/nm-device-macsec.c')
-rw-r--r--src/core/devices/nm-device-macsec.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/core/devices/nm-device-macsec.c b/src/core/devices/nm-device-macsec.c
index 32fab5be..89a06720 100644
--- a/src/core/devices/nm-device-macsec.c
+++ b/src/core/devices/nm-device-macsec.c
@@ -1022,36 +1022,18 @@ get_connection_parent(NMDeviceFactory *factory, NMConnection *connection)
     g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_MACSEC_SETTING_NAME), NULL);
 
     s_macsec = nm_connection_get_setting_macsec(connection);
-    g_assert(s_macsec);
-
-    parent = nm_setting_macsec_get_parent(s_macsec);
-    if (parent)
-        return parent;
+    if (s_macsec) {
+        parent = nm_setting_macsec_get_parent(s_macsec);
+        if (parent)
+            return parent;
+    }
 
     /* Try the hardware address from the MACsec connection's hardware setting */
     s_wired = nm_connection_get_setting_wired(connection);
     if (s_wired)
         return nm_setting_wired_get_mac_address(s_wired);
-
-    return NULL;
-}
-
-static char *
-get_connection_iface(NMDeviceFactory *factory, NMConnection *connection, const char *parent_iface)
-{
-    NMSettingMacsec *s_macsec;
-    const char      *ifname;
-
-    g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_MACSEC_SETTING_NAME), NULL);
-
-    s_macsec = nm_connection_get_setting_macsec(connection);
-    g_assert(s_macsec);
-
-    if (!parent_iface)
+    else
         return NULL;
-
-    ifname = nm_connection_get_interface_name(connection);
-    return g_strdup(ifname);
 }
 
 NM_DEVICE_FACTORY_DEFINE_INTERNAL(
@@ -1061,5 +1043,4 @@ NM_DEVICE_FACTORY_DEFINE_INTERNAL(
     NM_DEVICE_FACTORY_DECLARE_LINK_TYPES(NM_LINK_TYPE_MACSEC)
         NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES(NM_SETTING_MACSEC_SETTING_NAME),
     factory_class->create_device         = create_device;
-    factory_class->get_connection_parent = get_connection_parent;
-    factory_class->get_connection_iface  = get_connection_iface;)
+    factory_class->get_connection_parent = get_connection_parent;);