summary refs log tree commit diff
path: root/src/core/settings
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-03-07 21:30:42 +0100
committerMichael Biebl <biebl@debian.org>2022-03-07 21:30:42 +0100
commit4f887bccf1cde84106588536584a2d54a5b4e6e5 (patch)
tree454b1e2f3097b494dd9a4535815f382f214abf98 /src/core/settings
parent4e966a21b9ef4fb910a5bd1a5699d404a65cfe55 (diff)
New upstream version 1.36.2 upstream/1.36.2
Diffstat (limited to 'src/core/settings')
-rw-r--r--src/core/settings/nm-settings.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c
index da09571b..6619d3e0 100644
--- a/src/core/settings/nm-settings.c
+++ b/src/core/settings/nm-settings.c
@@ -3266,7 +3266,7 @@ add_plugin(NMSettings *self, NMSettingsPlugin *plugin, const char *pname, const
 }
 
 static gboolean
-add_plugin_load_file(NMSettings *self, const char *pname, GError **error)
+add_plugin_load_file(NMSettings *self, const char *pname, gboolean ignore_not_found, GError **error)
 {
     gs_free char                     *full_name = NULL;
     gs_free char                     *path      = NULL;
@@ -3281,10 +3281,12 @@ add_plugin_load_file(NMSettings *self, const char *pname, GError **error)
 
     if (stat(path, &st) != 0) {
         errsv = errno;
-        _LOGW("could not load plugin '%s' from file '%s': %s",
-              pname,
-              path,
-              nm_strerror_native(errsv));
+        if (!ignore_not_found) {
+            _LOGW("could not load plugin '%s' from file '%s': %s",
+                  pname,
+                  path,
+                  nm_strerror_native(errsv));
+        }
         return TRUE;
     }
     if (!S_ISREG(st.st_mode)) {
@@ -3378,7 +3380,7 @@ load_plugins(NMSettings *self, const char *const *plugins, GError **error)
             continue;
         }
 
-        success = add_plugin_load_file(self, pname, error);
+        success = add_plugin_load_file(self, pname, FALSE, error);
         if (!success)
             break;
     }
@@ -3872,8 +3874,18 @@ nm_settings_start(NMSettings *self, GError **error)
     /* Load the plugins; fail if a plugin is not found. */
     plugins = nm_config_data_get_plugins(nm_config_get_data_orig(priv->config), TRUE);
 
-    if (!load_plugins(self, (const char *const *) plugins, error))
-        return FALSE;
+    if (plugins && plugins[0]) {
+        if (!load_plugins(self, (const char *const *) plugins, error))
+            return FALSE;
+    } else {
+        add_plugin_keyfile(self);
+#if WITH_CONFIG_PLUGIN_IFCFG_RH
+        add_plugin_load_file(self, "ifcfg-rh", TRUE, NULL);
+#endif
+#if WITH_CONFIG_PLUGIN_IFUPDOWN
+        add_plugin_load_file(self, "ifupdown", TRUE, NULL);
+#endif
+    }
 
     for (iter = priv->plugins; iter; iter = iter->next) {
         NMSettingsPlugin *plugin = NM_SETTINGS_PLUGIN(iter->data);