diff options
author | 2018-12-13 19:59:46 +0100 | |
---|---|---|
committer | 2018-12-14 11:15:36 +0100 | |
commit | 1a359852641119db951da03bf9c67f9dc34d6257 (patch) | |
tree | 0e91e964237b89b8cc4bde80a08bdafded7b1c24 /man | |
parent | add device hwdb for IdeaPad Miix510-12ISK (diff) | |
download | systemd-1a359852641119db951da03bf9c67f9dc34d6257.tar.gz systemd-1a359852641119db951da03bf9c67f9dc34d6257.tar.bz2 systemd-1a359852641119db951da03bf9c67f9dc34d6257.zip |
in-addr-util: fix undefined result for in4_addr_netmask_to_prefixlen(<0.0.0.0>)
u32ctz() was undefined for zero due to __builtin_ctz() [1].
Explicitly check for zero to make the behavior defined.
Note that this issue only affected in4_addr_netmask_to_prefixlen()
which is the only caller.
It may seem slightly odd, to return 32 (bits) for utz(0). But that
is what in4_addr_netmask_to_prefixlen() needs, and it probably makes
the most sense here.
[1] https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
Fixes: ba91431154ad7bac82ddf0a540ec1b40db62d782
Diffstat (limited to 'man')
0 files changed, 0 insertions, 0 deletions