wg: Refactor selftest allowedips.c
commit4c074b47b517304248bc217c9070c6a4abb82fb4
authorAaron LI <aly@aaronly.me>
Sat, 27 Jan 2024 14:59:31 +0000 (27 22:59 +0800)
committerAaron LI <aly@aaronly.me>
Thu, 8 Feb 2024 06:44:48 +0000 (8 14:44 +0800)
tree2ae312f59fc682822df86db51086928b80ac25f7
parentcf257a5c38a2fa16fb19c8b039c24bf2b859c4f2
wg: Refactor selftest allowedips.c

- Refactor multiple functions and macros to make the implementation read
  better.
- Fix some memory free issues upon errors; e.g., kfree() panics if the
  given pointer is NULL.
- Add progress reports for the randomized test as it can take really
  long time (e.g., ~80 minutes on my test box).
- Various improvements and style cleanups.
sys/net/wg/selftest/allowedips.c