libnm: refactor wifi frequency handling in libnm

System Internals / NetworkManager - Thomas Haller [redhat.com] - 26 June 2020 07:29 UTC

- mark global variables as const. This allows the linker to mark the variable as read only.

- for nm_utils_wifi_[25]ghz_freqs(), don't generate a list based on bg_table/a_table. Instead, keep static array of frequencies. Since we have unit tests that check the consistency, this has little maintenance effort.

- add unit tests

5f202414d libnm: refactor wifi frequency handling in libnm
libnm-core/nm-utils.c | 190 ++++++++++++++++++++++++++--------------
libnm-core/tests/test-general.c | 50 +++++++++++
2 files changed, 176 insertions(+), 64 deletions(-)

Upstream: cgit.freedesktop.org


  • Share