aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Prestwood <prestwoj@gmail.com>2024-02-27 10:33:56 -0800
committerDenis Kenzior <denkenz@gmail.com>2024-02-27 13:55:37 -0600
commit3f04bc427d276db83d9b34216274093a69dcae47 (patch)
tree7ba6c7d738f891199ac24ad2b6e5bcdd3670d0f6
parent3ab09e0ae24580e25162ddccad67d7a9847526d9 (diff)
knownnetworks: add option to force a default ECC group
This adds the option [Settings].UseDefaultEccGroup which allows a network profile to specify the behavior when using an ECC-based protocol. If unset (default) IWD will learn the behavior of the network for the lifetime of its process. Many APs do not support group 20 which IWD tries first by default. This leads to an initial failure followed by a retry using group 19. This option will allow the user to configure IWD to use group 19 first or learn the network capabilities, if the authentication fails with group 20 IWD will always use group 19 for the process lifetime.
-rw-r--r--src/knownnetworks.c11
-rw-r--r--src/knownnetworks.h8
2 files changed, 19 insertions, 0 deletions
diff --git a/src/knownnetworks.c b/src/knownnetworks.c
index fc8100574..6f65d2b3c 100644
--- a/src/knownnetworks.c
+++ b/src/knownnetworks.c
@@ -123,6 +123,17 @@ void __network_config_parse(const struct l_settings *settings,
l_strfreev(modes);
}
+
+ if (l_settings_has_key(settings, NET_USE_DEFAULT_ECC_GROUP)) {
+ if (l_settings_get_bool(settings,
+ NET_USE_DEFAULT_ECC_GROUP, &b)) {
+ config->ecc_group = b ? KNOWN_NETWORK_ECC_GROUP_DEFAULT
+ : KNOWN_NETWORK_ECC_GROUP_MOST_SECURE;
+ } else
+ l_warn("[%s].%s is not a boolean value",
+ NET_USE_DEFAULT_ECC_GROUP);
+ } else
+ config->ecc_group = KNOWN_NETWORK_ECC_GROUP_AUTO;
}
void __network_info_init(struct network_info *info,
diff --git a/src/knownnetworks.h b/src/knownnetworks.h
index 741d42ed9..c81bd9aaa 100644
--- a/src/knownnetworks.h
+++ b/src/knownnetworks.h
@@ -27,6 +27,7 @@
#define NET_ADDRESS_OVERRIDE SETTINGS, "AddressOverride"
#define NET_TRANSITION_DISABLE SETTINGS, "TransitionDisable"
#define NET_TRANSITION_DISABLE_MODES SETTINGS, "DisabledTransitionModes"
+#define NET_USE_DEFAULT_ECC_GROUP SETTINGS, "UseDefaultEccGroup"
enum security;
struct scan_freq_set;
@@ -38,6 +39,12 @@ enum known_networks_event {
KNOWN_NETWORKS_EVENT_UPDATED,
};
+enum known_network_ecc_group {
+ KNOWN_NETWORK_ECC_GROUP_AUTO = 0,
+ KNOWN_NETWORK_ECC_GROUP_DEFAULT,
+ KNOWN_NETWORK_ECC_GROUP_MOST_SECURE,
+};
+
struct network_info_ops {
struct l_settings *(*open)(struct network_info *info);
int (*touch)(struct network_info *info);
@@ -72,6 +79,7 @@ struct network_config {
uint8_t sta_addr[6];
bool have_transition_disable : 1;
uint8_t transition_disable;
+ enum known_network_ecc_group ecc_group;
};
struct network_info {