core: remove NM_PROXY_CONFIG_METHOD_UNKNOWN

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.
This commit is contained in:
Beniamino Galvani 2023-01-26 11:39:06 +01:00
parent aa76b9fb3f
commit 374691d4b2
3 changed files with 6 additions and 11 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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;