summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-08-05 17:03:15 +0200
committerLubomir Rintel <lkundrak@v3.sk>2022-08-05 17:47:55 +0200
commit7881904eda6a7cd2af7d9670d56bed026d86b5bc (patch)
tree62afa35934e341536be25f7b219c5251825ac65f
parent3ce34510402517dfdffb8fc541c97ff8a457f0b9 (diff)
all: avoid useless use of NM_IN_STRSET()lr/strset
Sometimes NM_IN_STRSET() is used for comparing two strings. This hampers readability, making it look like the argument, if it's a macro, expands to multiple values. Other than that it's just odd and useless.
-rw-r--r--src/core/devices/nm-device-bond.c2
-rw-r--r--src/core/devices/nm-device.c14
-rw-r--r--src/core/devices/wifi/nm-device-iwd.c2
-rw-r--r--src/core/devices/wifi/nm-device-wifi-p2p.c4
-rw-r--r--src/core/devices/wifi/nm-device-wifi.c2
-rw-r--r--src/core/devices/wwan/nm-modem.c2
-rw-r--r--src/core/dhcp/nm-dhcp-helper.c4
-rw-r--r--src/core/nm-dbus-manager.c2
-rw-r--r--src/core/nm-manager.c2
-rw-r--r--src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c2
-rw-r--r--src/core/settings/plugins/keyfile/nms-keyfile-plugin.c2
-rw-r--r--src/core/supplicant/nm-supplicant-interface.c6
-rw-r--r--src/libnm-core-impl/nm-setting-bond.c4
-rw-r--r--src/libnm-core-impl/nm-setting-connection.c2
-rw-r--r--src/libnm-core-impl/nm-setting-ip-config.c20
-rw-r--r--src/libnm-core-impl/nm-setting-wireless-security.c2
-rw-r--r--src/libnm-glib-aux/tests/test-shared-general.c4
-rw-r--r--src/libnm-platform/nm-linux-platform.c2
-rw-r--r--src/libnmc-base/nm-vpn-helpers.c6
-rw-r--r--src/libnmc-setting/nm-meta-setting-desc.c2
-rw-r--r--src/nmcli/connections.c2
21 files changed, 44 insertions, 44 deletions
diff --git a/src/core/devices/nm-device-bond.c b/src/core/devices/nm-device-bond.c
index 21fe9b07eb..565171f551 100644
--- a/src/core/devices/nm-device-bond.c
+++ b/src/core/devices/nm-device-bond.c
@@ -175,7 +175,7 @@ update_connection(NMDevice *device, NMConnection *connection)
gs_free char *value = NULL;
char *p;
- if (NM_IN_STRSET(option, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE))
+ if (nm_streq(option, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE))
continue;
value =
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 6cc823b2ee..80350b4834 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -8862,8 +8862,8 @@ unmanaged_on_quit(NMDevice *self)
/* the only exception are IPv4 shared connections. We unmanage them on quit. */
connection = nm_device_get_applied_connection(self);
if (connection) {
- if (NM_IN_STRSET(nm_utils_get_ip_config_method(connection, AF_INET),
- NM_SETTING_IP4_CONFIG_METHOD_SHARED)) {
+ if (nm_streq(nm_utils_get_ip_config_method(connection, AF_INET),
+ NM_SETTING_IP4_CONFIG_METHOD_SHARED)) {
/* shared connections are to be unmangaed. */
return TRUE;
}
@@ -11866,9 +11866,9 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family, const
} else {
_dev_ipll6_start(self);
- if (NM_IN_STRSET(method, NM_SETTING_IP6_CONFIG_METHOD_AUTO))
+ if (nm_streq(method, NM_SETTING_IP6_CONFIG_METHOD_AUTO))
_dev_ipac6_start(self);
- else if (NM_IN_STRSET(method, NM_SETTING_IP6_CONFIG_METHOD_SHARED))
+ else if (nm_streq(method, NM_SETTING_IP6_CONFIG_METHOD_SHARED))
_dev_ipshared6_start(self);
else if (nm_streq(method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
priv->ipdhcp_data_6.v6.mode = NM_NDISC_DHCP_LEVEL_MANAGED;
@@ -16595,7 +16595,7 @@ _hw_addr_get_cloned(NMDevice *self,
}
addr_out = g_strdup(addr);
type_out = HW_ADDR_TYPE_PERMANENT;
- } else if (NM_IN_STRSET(addr, NM_CLONED_MAC_RANDOM)) {
+ } else if (nm_streq(addr, NM_CLONED_MAC_RANDOM)) {
if (priv->hw_addr_type == HW_ADDR_TYPE_GENERATED) {
/* hm, we already use a generate MAC address. Most certainly, that is from the same
* activation request, so we should not create a new random address, instead keep
@@ -16616,7 +16616,7 @@ _hw_addr_get_cloned(NMDevice *self,
addr_out = g_steal_pointer(&hw_addr_generated);
type_out = HW_ADDR_TYPE_GENERATED;
- } else if (NM_IN_STRSET(addr, NM_CLONED_MAC_STABLE)) {
+ } else if (nm_streq(addr, NM_CLONED_MAC_STABLE)) {
NMUtilsStableType stable_type;
const char *stable_id;
@@ -17089,7 +17089,7 @@ nm_device_get_hostname_from_dns_lookup(NMDevice *self, int addr_family, gboolean
method = nm_device_get_effective_ip_config_method(self, addr_family);
if (IS_IPv4) {
- if (NM_IN_STRSET(method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
+ if (nm_streq(method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
nm_clear_pointer(&priv->hostname_resolver_x[IS_IPv4], _hostname_resolver_free);
NM_SET_OUT(out_wait, FALSE);
return NULL;
diff --git a/src/core/devices/wifi/nm-device-iwd.c b/src/core/devices/wifi/nm-device-iwd.c
index ab37cbec91..bb01c1c674 100644
--- a/src/core/devices/wifi/nm-device-iwd.c
+++ b/src/core/devices/wifi/nm-device-iwd.c
@@ -2826,7 +2826,7 @@ state_changed(NMDeviceIwd *self, const char *new_state)
/* Don't allow new connection until iwd exits disconnecting and no
* Connect callback is pending.
*/
- if (!priv->iwd_autoconnect && NM_IN_STRSET(new_state, "disconnected")) {
+ if (!priv->iwd_autoconnect && nm_streq(new_state, "disconnected")) {
priv->nm_autoconnect = TRUE;
if (!can_connect)
nm_device_emit_recheck_auto_activate(device);
diff --git a/src/core/devices/wifi/nm-device-wifi-p2p.c b/src/core/devices/wifi/nm-device-wifi-p2p.c
index 4576af95cb..5c5a1fc724 100644
--- a/src/core/devices/wifi/nm-device-wifi-p2p.c
+++ b/src/core/devices/wifi/nm-device-wifi-p2p.c
@@ -567,7 +567,7 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
method = nm_utils_get_ip_config_method(connection, addr_family);
/* We may have an address assigned by the group owner */
- if (IS_IPv4 && NM_IN_STRSET(method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) && priv->group_iface
+ if (IS_IPv4 && nm_streq(method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) && priv->group_iface
&& !nm_supplicant_interface_get_p2p_group_owner(priv->group_iface)) {
in_addr_t addr;
guint8 plen;
@@ -591,7 +591,7 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
}
if (IS_IPv4)
- indicate_addressing_running = NM_IN_STRSET(method, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+ indicate_addressing_running = nm_streq(method, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
else {
indicate_addressing_running = NM_IN_STRSET(method,
NM_SETTING_IP6_CONFIG_METHOD_AUTO,
diff --git a/src/core/devices/wifi/nm-device-wifi.c b/src/core/devices/wifi/nm-device-wifi.c
index 39c68d777f..45c9e32205 100644
--- a/src/core/devices/wifi/nm-device-wifi.c
+++ b/src/core/devices/wifi/nm-device-wifi.c
@@ -3399,7 +3399,7 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
method = nm_utils_get_ip_config_method(nm_device_get_applied_connection(device), addr_family);
if (NM_IS_IPv4(addr_family))
- indicate_addressing_running = NM_IN_STRSET(method, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+ indicate_addressing_running = nm_streq(method, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
else {
indicate_addressing_running = NM_IN_STRSET(method,
NM_SETTING_IP6_CONFIG_METHOD_AUTO,
diff --git a/src/core/devices/wwan/nm-modem.c b/src/core/devices/wwan/nm-modem.c
index a5ee8ce8ed..63a3e497ef 100644
--- a/src/core/devices/wwan/nm-modem.c
+++ b/src/core/devices/wwan/nm-modem.c
@@ -721,7 +721,7 @@ _stage3_ip_config_start_on_idle(NMModem *self, int addr_family)
method = nm_utils_get_ip_config_method(connection, addr_family);
- if (IS_IPv4 ? NM_IN_STRSET(method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)
+ if (IS_IPv4 ? nm_streq(method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)
: NM_IN_STRSET(method,
NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
NM_SETTING_IP6_CONFIG_METHOD_DISABLED)) {
diff --git a/src/core/dhcp/nm-dhcp-helper.c b/src/core/dhcp/nm-dhcp-helper.c
index 5a17f4e8ab..e85e9864cb 100644
--- a/src/core/dhcp/nm-dhcp-helper.c
+++ b/src/core/dhcp/nm-dhcp-helper.c
@@ -182,13 +182,13 @@ do_notify:
s_err = g_dbus_error_get_remote_error(error);
- if (NM_IN_STRSET(s_err, "org.freedesktop.NetworkManager.Device.Failed")) {
+ if (nm_streq(s_err, "org.freedesktop.NetworkManager.Device.Failed")) {
_LOGi("notify failed with reason: %s", error->message);
success = FALSE;
goto out;
}
- if (!NM_IN_STRSET(s_err, "org.freedesktop.DBus.Error.UnknownMethod")) {
+ if (!nm_streq(s_err, "org.freedesktop.DBus.Error.UnknownMethod")) {
/* Some unexpected error. We treat that as a failure. In particular,
* the daemon will fail the request if ACD fails. This causes nm-dhcp-helper
* to fail, which in turn causes dhclient to send a DECLINE. */
diff --git a/src/core/nm-dbus-manager.c b/src/core/nm-dbus-manager.c
index 7fcbf6cad8..0d499651a3 100644
--- a/src/core/nm-dbus-manager.c
+++ b/src/core/nm-dbus-manager.c
@@ -314,7 +314,7 @@ private_server_allow_mechanism(GDBusAuthObserver *observer,
const char *mechanism,
gpointer user_data)
{
- return NM_IN_STRSET(mechanism, "EXTERNAL");
+ return nm_streq(mechanism, "EXTERNAL");
}
static void
diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c
index 3af24aa00b..48d5198053 100644
--- a/src/core/nm-manager.c
+++ b/src/core/nm-manager.c
@@ -7439,7 +7439,7 @@ _dbus_set_property_audit_log_get_args(NMDBusObject *obj,
property_name,
g_variant_get_boolean(value) ? "on" : "off"));
}
- if (NM_IN_STRSET(property_name, NM_MANAGER_GLOBAL_DNS_CONFIGURATION)) {
+ if (nm_streq(property_name, NM_MANAGER_GLOBAL_DNS_CONFIGURATION)) {
return NM_MANAGER_GLOBAL_DNS_CONFIGURATION;
}
diff --git a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
index 9fdae4bd25..fe1945aa72 100644
--- a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
+++ b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
@@ -9146,7 +9146,7 @@ _svUnescape(const char *str, char **to_free)
g_assert(!to_free2);
g_assert_cmpstr(s, ==, "");
g_assert(!*to_free);
- } else if (NM_IN_STRSET(str, "$'x\\U0'")) {
+ } else if (nm_streq(str, "$'x\\U0'")) {
g_assert_cmpstr(s2, ==, NULL);
g_assert(!to_free2);
g_assert_cmpstr(s, ==, "x");
diff --git a/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c b/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c
index 1d7de8d24b..fb832f7d17 100644
--- a/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c
+++ b/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c
@@ -1267,7 +1267,7 @@ nms_keyfile_plugin_init(NMSKeyfilePlugin *plugin)
/* no duplicates */
if (NM_IN_STRSET(priv->dirname_libs[0], priv->dirname_etc, priv->dirname_run))
nm_clear_g_free(&priv->dirname_libs[0]);
- if (NM_IN_STRSET(priv->dirname_etc, priv->dirname_run))
+ if (nm_streq(priv->dirname_etc, priv->dirname_run))
nm_clear_g_free(&priv->dirname_etc);
nm_assert(!priv->dirname_libs[0] || priv->dirname_libs[0][0] == '/');
diff --git a/src/core/supplicant/nm-supplicant-interface.c b/src/core/supplicant/nm-supplicant-interface.c
index fa8b4e3713..0cc56669de 100644
--- a/src/core/supplicant/nm-supplicant-interface.c
+++ b/src/core/supplicant/nm-supplicant-interface.c
@@ -293,7 +293,7 @@ security_from_vardict(GVariant *security)
flags |= NM_802_11_AP_SEC_KEY_MGMT_802_1X;
else if (NM_IN_STRSET(v, "sae", "ft-sae"))
flags |= NM_802_11_AP_SEC_KEY_MGMT_SAE;
- else if (NM_IN_STRSET(v, "owe"))
+ else if (nm_streq(v, "owe"))
flags |= NM_802_11_AP_SEC_KEY_MGMT_OWE;
else if (NM_IN_STRSET(v, "wpa-eap-suite-b-192", "wpa-ft-eap-sha384"))
flags |= NM_802_11_AP_SEC_KEY_MGMT_EAP_SUITE_B_192;
@@ -303,9 +303,9 @@ security_from_vardict(GVariant *security)
if (g_variant_lookup(security, "Pairwise", "^a&s", &array)) {
for (i = 0; (v = array[i]); i++) {
- if (NM_IN_STRSET(v, "tkip"))
+ if (nm_streq(v, "tkip"))
flags |= NM_802_11_AP_SEC_PAIR_TKIP;
- else if (NM_IN_STRSET(v, "ccmp"))
+ else if (nm_streq(v, "ccmp"))
flags |= NM_802_11_AP_SEC_PAIR_CCMP;
}
g_free(array);
diff --git a/src/libnm-core-impl/nm-setting-bond.c b/src/libnm-core-impl/nm-setting-bond.c
index 2984e6fc22..48a2438b18 100644
--- a/src/libnm-core-impl/nm-setting-bond.c
+++ b/src/libnm-core-impl/nm-setting-bond.c
@@ -335,11 +335,11 @@ _bond_get_option_normalized(NMSettingBond *self, const char *option, gboolean ge
value = _bond_get_option(self, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP);
if (!value)
value = _bond_get_option(self, NM_SETTING_BOND_OPTION_NUM_UNSOL_NA);
- } else if (NM_IN_STRSET(option, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE)) {
+ } else if (nm_streq(option, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE)) {
/* "active_slave" is deprecated, and an alias for "primary". The property
* itself always normalizes to %NULL. */
value = NULL;
- } else if (NM_IN_STRSET(option, NM_SETTING_BOND_OPTION_PRIMARY)) {
+ } else if (nm_streq(option, NM_SETTING_BOND_OPTION_PRIMARY)) {
/* "active_slave" is deprecated, and an alias for "primary". */
value = _bond_get_option(self, NM_SETTING_BOND_OPTION_PRIMARY);
if (!value)
diff --git a/src/libnm-core-impl/nm-setting-connection.c b/src/libnm-core-impl/nm-setting-connection.c
index 987c4fa041..1d126016d5 100644
--- a/src/libnm-core-impl/nm-setting-connection.c
+++ b/src/libnm-core-impl/nm-setting-connection.c
@@ -1258,7 +1258,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
if (connection)
goto after_interface_name;
iface_type = NMU_IFACE_ANY;
- } else if (NM_IN_STRSET(ovs_iface_type, "patch")) {
+ } else if (nm_streq(ovs_iface_type, "patch")) {
/* this interface type is internal to OVS. */
iface_type = NMU_IFACE_OVS;
} else {
diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c
index ab760c4e5f..26ea2785ca 100644
--- a/src/libnm-core-impl/nm-setting-ip-config.c
+++ b/src/libnm-core-impl/nm-setting-ip-config.c
@@ -3417,7 +3417,7 @@ nm_ip_routing_rule_from_string(const char *str,
/* iproute2 matches keywords with any partial prefix. We don't allow
* for that flexibility. */
- if (NM_IN_STRSET(word0, "from")) {
+ if (nm_streq(word0, "from")) {
if (!word1)
continue;
if (word_from)
@@ -3425,7 +3425,7 @@ nm_ip_routing_rule_from_string(const char *str,
word_from = word1;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "to")) {
+ if (nm_streq(word0, "to")) {
if (!word1)
continue;
if (word_to)
@@ -3433,7 +3433,7 @@ nm_ip_routing_rule_from_string(const char *str,
word_to = word1;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "not")) {
+ if (nm_streq(word0, "not")) {
/* we accept multiple "not" specifiers. "not not" still means
* not. */
val_invert = TRUE;
@@ -3477,7 +3477,7 @@ nm_ip_routing_rule_from_string(const char *str,
goto next_fail_word1_invalid_value;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "ipproto")) {
+ if (nm_streq(word0, "ipproto")) {
if (!word1)
continue;
if (i64_ipproto != -1)
@@ -3487,7 +3487,7 @@ nm_ip_routing_rule_from_string(const char *str,
goto next_fail_word1_invalid_value;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "sport")) {
+ if (nm_streq(word0, "sport")) {
if (!word1)
continue;
if (i64_sport_start != -1)
@@ -3496,7 +3496,7 @@ nm_ip_routing_rule_from_string(const char *str,
goto next_fail_word1_invalid_value;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "dport")) {
+ if (nm_streq(word0, "dport")) {
if (!word1)
continue;
if (i64_dport_start != -1)
@@ -3505,7 +3505,7 @@ nm_ip_routing_rule_from_string(const char *str,
goto next_fail_word1_invalid_value;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "fwmark")) {
+ if (nm_streq(word0, "fwmark")) {
if (!word1)
continue;
if (i64_fwmark != -1)
@@ -3532,7 +3532,7 @@ nm_ip_routing_rule_from_string(const char *str,
word_iifname = word1;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "oif")) {
+ if (nm_streq(word0, "oif")) {
if (!word1)
continue;
if (word_oifname)
@@ -3550,7 +3550,7 @@ nm_ip_routing_rule_from_string(const char *str,
goto next_fail_word1_invalid_value;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "uidrange")) {
+ if (nm_streq(word0, "uidrange")) {
if (!word1)
continue;
if (uid_range_has)
@@ -3572,7 +3572,7 @@ nm_ip_routing_rule_from_string(const char *str,
uid_range_has = TRUE;
goto next_words_consumed;
}
- if (NM_IN_STRSET(word0, "type")) {
+ if (nm_streq(word0, "type")) {
if (!word1)
continue;
if (i_action >= 0)
diff --git a/src/libnm-core-impl/nm-setting-wireless-security.c b/src/libnm-core-impl/nm-setting-wireless-security.c
index d9c5afb873..73609584b8 100644
--- a/src/libnm-core-impl/nm-setting-wireless-security.c
+++ b/src/libnm-core-impl/nm-setting-wireless-security.c
@@ -934,7 +934,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (NM_IN_STRSET(wifi_mode, NM_SETTING_WIRELESS_MODE_MESH)
+ if (nm_streq(wifi_mode, NM_SETTING_WIRELESS_MODE_MESH)
&& !NM_IN_STRSET(priv->key_mgmt, "none", "sae")) {
g_set_error(error,
NM_CONNECTION_ERROR,
diff --git a/src/libnm-glib-aux/tests/test-shared-general.c b/src/libnm-glib-aux/tests/test-shared-general.c
index a4817e1973..4b403f9796 100644
--- a/src/libnm-glib-aux/tests/test-shared-general.c
+++ b/src/libnm-glib-aux/tests/test-shared-general.c
@@ -1092,9 +1092,9 @@ test_in_strset_ascii_case(void)
g_assert(!NM_IN_STRSET_ASCII_CASE(x, "b"));
x = "b";
- g_assert(NM_IN_STRSET(x, "b"));
+ g_assert(nm_streq(x, "b"));
g_assert(NM_IN_STRSET_ASCII_CASE(x, "b"));
- g_assert(!NM_IN_STRSET(x, "B"));
+ g_assert(!nm_streq(x, "B"));
g_assert(NM_IN_STRSET_ASCII_CASE(x, "B"));
}
diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c
index ee5cb10434..6fc3d02e12 100644
--- a/src/libnm-platform/nm-linux-platform.c
+++ b/src/libnm-platform/nm-linux-platform.c
@@ -10026,7 +10026,7 @@ handle_udev_event(NMUdevClient *udev_client, struct udev_device *udevice, gpoint
if (NM_IN_STRSET(action, "add", "move"))
udev_device_added(platform, udevice);
- else if (NM_IN_STRSET(action, "remove"))
+ else if (nm_streq(action, "remove"))
udev_device_removed(platform, udevice);
}
diff --git a/src/libnmc-base/nm-vpn-helpers.c b/src/libnmc-base/nm-vpn-helpers.c
index 7ad5bee509..c62e782fcf 100644
--- a/src/libnmc-base/nm-vpn-helpers.c
+++ b/src/libnmc-base/nm-vpn-helpers.c
@@ -143,13 +143,13 @@ nm_vpn_get_secret_names(const char *service_type)
return _VPN_PASSWORD_LIST({"password", N_("Password")}, );
}
- if (NM_IN_STRSET(type, "openvpn")) {
+ if (nm_streq(type, "openvpn")) {
return _VPN_PASSWORD_LIST({"password", N_("Password")},
{"cert-pass", N_("Certificate password")},
{"http-proxy-password", N_("HTTP proxy password")}, );
}
- if (NM_IN_STRSET(type, "vpnc")) {
+ if (nm_streq(type, "vpnc")) {
return _VPN_PASSWORD_LIST({"Xauth password", N_("Password")},
{"IPSec secret", N_("Group password")}, );
};
@@ -159,7 +159,7 @@ nm_vpn_get_secret_names(const char *service_type)
{"pskvalue", N_("Group password")}, );
};
- if (NM_IN_STRSET(type, "openconnect")) {
+ if (nm_streq(type, "openconnect")) {
return _VPN_PASSWORD_LIST({"gateway", N_("Gateway")},
{"cookie", N_("Cookie")},
{"gwcert", N_("Gateway certificate hash")}, );
diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c
index 0952c016cf..301ec9fde8 100644
--- a/src/libnmc-setting/nm-meta-setting-desc.c
+++ b/src/libnmc-setting/nm-meta-setting-desc.c
@@ -917,7 +917,7 @@ _get_fcn_gobject_impl(const NMMetaPropertyInfo *property_info,
nm_assert(property_info->setting_info
== &nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_WIRED]
- && NM_IN_STRSET(property_info->property_name, NM_SETTING_WIRED_S390_OPTIONS));
+ && nm_streq(property_info->property_name, NM_SETTING_WIRED_S390_OPTIONS));
nm_assert(property_info->property_type->set_fcn == _set_fcn_optionlist);
strdict = g_value_get_boxed(&val);
diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c
index 8c6ebd9897..61b2ac3651 100644
--- a/src/nmcli/connections.c
+++ b/src/nmcli/connections.c
@@ -4775,7 +4775,7 @@ set_bluetooth_type(NmCli *nmc,
&nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_GSM],
NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI);
nm_connection_add_setting(con, setting);
- } else if (NM_IN_STRSET(value, NM_SETTING_BLUETOOTH_TYPE_DUN "-cdma")) {
+ } else if (nm_streq(value, NM_SETTING_BLUETOOTH_TYPE_DUN "-cdma")) {
value = NM_SETTING_BLUETOOTH_TYPE_DUN;
setting = nm_setting_cdma_new();
nm_connection_add_setting(con, setting);