eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 1a554a300d73489213c137776c1da69b074303f1
parent 6cc6a8a2cbba69acddcf7eda73e9ea3d052f87ac
Author: Vivek Das Mohapatra <vivek@collabora.com>
Date:   Sat,  5 Oct 2024 03:19:29 +0100

mpdu: tolerate technically illegal but harmless cloned IEs

Diffstat:
Msrc/ie.h | 17+++++++++++++++++
Msrc/mpdu.c | 7+++++++
2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/ie.h b/src/ie.h @@ -598,6 +598,23 @@ static inline const unsigned char *ie_tlv_iter_get_data( return iter->data; } +static inline bool ie_tlv_iter_data_eq(struct ie_tlv_iter *a, + struct ie_tlv_iter *b) +{ + if (a == b) + return true; + + if (a == NULL || b == NULL) + return false; + + if (ie_tlv_iter_get_length(a) != ie_tlv_iter_get_length(b)) + return false; + + return memcmp(ie_tlv_iter_get_data(a), + ie_tlv_iter_get_data(b), + ie_tlv_iter_get_length(a)) == 0; +} + void *ie_tlv_extract_wsc_payload(const uint8_t *ies, size_t len, ssize_t *out_len); void *ie_tlv_encapsulate_wsc_payload(const uint8_t *data, size_t len, diff --git a/src/mpdu.c b/src/mpdu.c @@ -398,9 +398,16 @@ static bool validate_mgmt_ies(const uint8_t *ies, size_t ies_len, memcpy(&clone, &iter, sizeof(clone)); + /* + * Some APs send completely identical duplicate IEs: + * Since these are harmless (and ignored by us) we're + * going to allow them here for interoperability. + */ while (ie_tlv_iter_next(&clone)) { if (ie_tlv_iter_get_tag(&clone) != tag) continue; + else if (ie_tlv_iter_data_eq(&iter, &clone)) + continue; return false; }