From 1d920d2634d1860f27c7bd098ad956993cbceb5b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 26 Aug 2021 17:19:04 +0200 Subject: [PATCH] core: use _nm_connection_ensure_setting() in controller_update_port_connection() --- src/core/devices/nm-device-bond.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/devices/nm-device-bond.c b/src/core/devices/nm-device-bond.c index a2414a1bde..a8997cc576 100644 --- a/src/core/devices/nm-device-bond.c +++ b/src/core/devices/nm-device-bond.c @@ -228,11 +228,7 @@ controller_update_port_connection(NMDevice * self, g_return_val_if_fail(ifindex_port > 0, FALSE); - s_port = _nm_connection_get_setting_bond_port(connection); - if (!s_port) { - s_port = NM_SETTING_BOND_PORT(nm_setting_bond_port_new()); - nm_connection_add_setting(connection, NM_SETTING(s_port)); - } + s_port = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_BOND_PORT); queue_id_str = nm_platform_sysctl_slave_get_option(nm_device_get_platform(self), ifindex_port, "queue_id");