Commit db544c62 authored by Marek Vavrusa's avatar Marek Vavrusa

lib/utils: fixed full subnet mask length calc

previously, if no subnet was given (127.0.0.0),
it was treated as 127.0.0.0/0. now it is treated
as full address length, e.g. 127.0.0.0/32
parent c396481e
......@@ -293,6 +293,9 @@ int kr_straddr_subnet(void *dst, const char *addr)
if (bit_len < 0 || bit_len > max_len) {
return kr_error(ERANGE);
}
} else {
/* No subnet, use maximal subnet length. */
bit_len = (family == AF_INET6) ? 128 : 32;
}
/* Parse address */
int ret = inet_pton(family, addr_str, dst);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment