]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: simplify setting of ImdsNetworkMode default
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 26 Mar 2026 16:28:21 +0000 (17:28 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 26 Mar 2026 16:28:21 +0000 (17:28 +0100)
This follows the pattern used for dnssec default mode right above.

meson.build
src/imds/imds-generator.c

index 2893bea332f29b21f6ced5164d717bd91395c8fe..03e337dccb61fc7f95544598e683bc45bcb016ff 100644 (file)
@@ -1544,7 +1544,7 @@ have = get_option('imds').require(
         conf.get('HAVE_LIBCURL') == 1,
         error_message : 'curl required').allowed()
 conf.set10('ENABLE_IMDS', have)
-conf.set10('IMDS_NETWORK_LOCKED_DEFAULT', get_option('imds-network') == 'locked')
+conf.set('IMDS_NETWORK_DEFAULT', 'IMDS_NETWORK_@0@'.format(get_option('imds-network')).to_upper())
 
 have = get_option('importd').require(
         conf.get('HAVE_LIBCURL') == 1 and
index 9cb48688a8c646049543a63e5e8e1e2e71a44b6e..42399783faac5349c6a95ec4e9bd75c3c2d6de10 100644 (file)
@@ -15,8 +15,7 @@
 
 static int arg_enabled = -1;           /* Whether we shall offer local IMDS APIs */
 static bool arg_import = true;         /* Whether we shall import IMDS credentials, SSH keys, … into the local system */
-static ImdsNetworkMode arg_network_mode =
-        IMDS_NETWORK_LOCKED_DEFAULT ? IMDS_NETWORK_LOCKED : IMDS_NETWORK_UNLOCKED;
+static ImdsNetworkMode arg_network_mode = IMDS_NETWORK_DEFAULT;
 
 static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
         int r;