From 32eb50bb580ef28f7a7c93e157530c6e8af6200a Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 19 Nov 2024 12:33:02 +0100 Subject: [PATCH] cloud-setup: skip connections unless given type mismatches Wired and Ipv4 always there, rest varies by connection type (Wired, Vlan, MacVlan). --- src/nm-cloud-setup/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nm-cloud-setup/main.c b/src/nm-cloud-setup/main.c index 3fe6621514..bc04cde13a 100644 --- a/src/nm-cloud-setup/main.c +++ b/src/nm-cloud-setup/main.c @@ -391,11 +391,12 @@ _nmc_skip_connection_by_user_data(NMConnection *connection) } static gboolean -_nmc_skip_connection_by_type(NMConnection *connection) +_nmc_skip_connection_by_type(NMConnection *connection, const char *connection_type) { - if (!nm_streq0(nm_connection_get_connection_type(connection), NM_SETTING_WIRED_SETTING_NAME)) + if (!nm_streq0(nm_connection_get_connection_type(connection), connection_type)) + return TRUE; + if (!nm_connection_get_setting_wired(connection)) return TRUE; - if (!nm_connection_get_setting_ip4_config(connection)) return TRUE; @@ -636,7 +637,7 @@ try_again: return any_changes; } - if (_nmc_skip_connection_by_type(applied_connection)) { + if (_nmc_skip_connection_by_type(applied_connection, NM_SETTING_WIRED_SETTING_NAME)) { _LOGD("config device %s: device has no suitable applied connection. Skip", hwaddr); return any_changes; }