diff options
Diffstat (limited to 'src/shared/netif-naming-scheme.c')
-rw-r--r-- | src/shared/netif-naming-scheme.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/netif-naming-scheme.c b/src/shared/netif-naming-scheme.c index 0a80931b0f..287a942014 100644 --- a/src/shared/netif-naming-scheme.c +++ b/src/shared/netif-naming-scheme.c @@ -5,6 +5,13 @@ #include "proc-cmdline.h" #include "string-util.h" +#ifdef _DEFAULT_NET_NAMING_SCHEME_TEST +/* The primary purpose of this check is to verify that _DEFAULT_NET_NAMING_SCHEME_TEST + * is a valid identifier. If an invalid name is given during configuration, this will + * fail with a name error. */ +assert_cc(_DEFAULT_NET_NAMING_SCHEME_TEST >= 0); +#endif + static const NamingScheme naming_schemes[] = { { "v238", NAMING_V238 }, { "v239", NAMING_V239 }, @@ -15,10 +22,9 @@ static const NamingScheme naming_schemes[] = { { "v247", NAMING_V247 }, { "v249", NAMING_V249 }, /* … add more schemes here, as the logic to name devices is updated … */ - /* also remember to update the list of options in meson_options.txt */ }; -static const NamingScheme* naming_scheme_from_name(const char *name) { +const NamingScheme* naming_scheme_from_name(const char *name) { if (streq(name, "latest")) return naming_schemes + ELEMENTSOF(naming_schemes) - 1; |