summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2023-01-26 11:39:06 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2023-01-30 11:06:38 +0100
commit374691d4b27780dae990195833061a08ab6c3a75 (patch)
tree670a6a2fa4a96e28480b5984e368be07474fbdeb
parentaa76b9fb3f06e9fa6c4105c590d86326538e658f (diff)
core: remove NM_PROXY_CONFIG_METHOD_UNKNOWNbg/proxy
I don't see a reason to have NM_PROXY_CONFIG_METHOD_UNKNOWN, as it is treated exactly the same as NM_PROXY_CONFIG_METHOD_NONE, i.e. they both send a "direct" method to pacrunner. The only difference is that UNKNOWN indicates the absence of the proxy setting in the profile, but that is the same as having the setting with method=none.
-rw-r--r--src/core/nm-l3-config-data.c13
-rw-r--r--src/core/nm-l3-config-data.h1
-rw-r--r--src/core/nm-pacrunner-manager.c3
3 files changed, 6 insertions, 11 deletions
diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c
index 1c8200c248..ce8f5507a2 100644
--- a/src/core/nm-l3-config-data.c
+++ b/src/core/nm-l3-config-data.c
@@ -592,8 +592,8 @@ nm_l3_config_data_log(const NML3ConfigData *self,
if (self->proxy_browser_only != NM_TERNARY_DEFAULT)
_L("proxy-browser-only: %s", self->proxy_browser_only ? "yes" : "no");
- if (self->proxy_method != NM_PROXY_CONFIG_METHOD_UNKNOWN)
- _L("proxy-method: %s", self->proxy_method == NM_PROXY_CONFIG_METHOD_AUTO ? "auto" : "none");
+ if (self->proxy_method != NM_PROXY_CONFIG_METHOD_NONE)
+ _L("proxy-method: auto");
if (self->proxy_pac_url)
_L("proxy-pac-url: %s", self->proxy_pac_url->str);
@@ -685,7 +685,7 @@ nm_l3_config_data_new(NMDedupMultiIndex *multi_idx, int ifindex, NMIPConfigSourc
.flags = NM_L3_CONFIG_DAT_FLAGS_NONE,
.metered = NM_TERNARY_DEFAULT,
.proxy_browser_only = NM_TERNARY_DEFAULT,
- .proxy_method = NM_PROXY_CONFIG_METHOD_UNKNOWN,
+ .proxy_method = NM_PROXY_CONFIG_METHOD_NONE,
.route_table_sync_4 = NM_IP_ROUTE_TABLE_SYNC_MODE_NONE,
.route_table_sync_6 = NM_IP_ROUTE_TABLE_SYNC_MODE_NONE,
.never_default_6 = NM_OPTION_BOOL_DEFAULT,
@@ -1945,10 +1945,7 @@ gboolean
nm_l3_config_data_set_proxy_method(NML3ConfigData *self, NMProxyConfigMethod value)
{
nm_assert(_NM_IS_L3_CONFIG_DATA(self, FALSE));
- nm_assert(NM_IN_SET(value,
- NM_PROXY_CONFIG_METHOD_UNKNOWN,
- NM_PROXY_CONFIG_METHOD_NONE,
- NM_PROXY_CONFIG_METHOD_AUTO));
+ nm_assert(NM_IN_SET(value, NM_PROXY_CONFIG_METHOD_NONE, NM_PROXY_CONFIG_METHOD_AUTO));
if (self->proxy_method == value)
return FALSE;
@@ -3259,7 +3256,7 @@ nm_l3_config_data_merge(NML3ConfigData *self,
self->metered = NM_MAX((NMTernary) self->metered, (NMTernary) src->metered);
- if (self->proxy_method == NM_PROXY_CONFIG_METHOD_UNKNOWN)
+ if (self->proxy_method == NM_PROXY_CONFIG_METHOD_NONE)
self->proxy_method = src->proxy_method;
if (self->proxy_browser_only == NM_TERNARY_DEFAULT)
diff --git a/src/core/nm-l3-config-data.h b/src/core/nm-l3-config-data.h
index 1a181e5cc1..ba97858ce9 100644
--- a/src/core/nm-l3-config-data.h
+++ b/src/core/nm-l3-config-data.h
@@ -10,7 +10,6 @@
#include "libnm-platform/nmp-object.h"
typedef enum {
- NM_PROXY_CONFIG_METHOD_UNKNOWN,
NM_PROXY_CONFIG_METHOD_NONE,
NM_PROXY_CONFIG_METHOD_AUTO,
} NMProxyConfigMethod;
diff --git a/src/core/nm-pacrunner-manager.c b/src/core/nm-pacrunner-manager.c
index 80db755fd7..69d197ea92 100644
--- a/src/core/nm-pacrunner-manager.c
+++ b/src/core/nm-pacrunner-manager.c
@@ -172,7 +172,7 @@ _make_request_create_proxy_configuration(const char *iface, const NML3ConfigData
g_variant_builder_add(&builder, "{sv}", "Interface", g_variant_new_string(iface));
}
- method = l3cd ? nm_l3_config_data_get_proxy_method(l3cd) : NM_PROXY_CONFIG_METHOD_UNKNOWN;
+ method = l3cd ? nm_l3_config_data_get_proxy_method(l3cd) : NM_PROXY_CONFIG_METHOD_NONE;
switch (method) {
case NM_PROXY_CONFIG_METHOD_AUTO:
@@ -186,7 +186,6 @@ _make_request_create_proxy_configuration(const char *iface, const NML3ConfigData
if (s)
g_variant_builder_add(&builder, "{sv}", "Script", g_variant_new_string(s));
break;
- case NM_PROXY_CONFIG_METHOD_UNKNOWN:
case NM_PROXY_CONFIG_METHOD_NONE:
g_variant_builder_add(&builder, "{sv}", "Method", g_variant_new_string("direct"));
break;