]> Kevux Git Server - fll/commit
Bugfix: Invalid IPv6 addressdetection and improve IPv4 address detection in f_network...
authorKevin Day <Kevin@kevux.org>
Wed, 28 Jan 2026 05:44:03 +0000 (23:44 -0600)
committerKevin Day <Kevin@kevux.org>
Wed, 28 Jan 2026 05:52:00 +0000 (23:52 -0600)
commite434fd7318987873e16d719b4d02a9172dd6bd43
tree8cb6fa9e56a1839c68f0b7fc2c5f2e0c82e07cb8
parentabd167c465e5848a3e18fb9b77d0b69c2553a7de
Bugfix: Invalid IPv6 addressdetection and improve IPv4 address detection in f_network_is_ip_address().

The `f_network_is_ip_address()` is not properly identifying bracketed IPv6 addresses.

Digits to the left of double colons `::` should be supported.
The forward slash `/` should be allowed after double colons `::`.
Ending in a double colon `::` is in fact valid in situations, such as with `::/0`.

Make the IPv6 logic easier to follow by adding additional comments.
Also rename `count` to `digits` to further make the code logic more understandable.

Improve IPv4 detection by checking if the number is between 0 and 255, inclusively.

Add more unit tests to better catch the newly identified and now resolved problems.
Update unit tests to use the newer `macro_f_string_static_t_initialize_2()` instead of `macro_f_string_static_t_initialize_1()`.
Add additional comments to help identify rows.
level_0/f_network/c/network.c
level_0/f_network/c/network.h
level_0/f_network/data/documentation/man/man3/f_network_is_ip_address.3
level_0/f_network/tests/unit/c/test-network-is_ip_address.c