basic/in-addr-util: add IN_ADDR_PREFIX_TO_STRING

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-06-06 09:52:52 +02:00
parent 61af181344
commit c71384a9ee
18 changed files with 155 additions and 223 deletions
+4 -6
View File
@@ -712,13 +712,11 @@ int config_parse_wireguard_allowed_ips(
masked = addr;
assert_se(in_addr_mask(family, &masked, prefixlen) >= 0);
if (!in_addr_equal(family, &masked, &addr)) {
_cleanup_free_ char *buf = NULL;
(void) in_addr_prefix_to_string(family, &masked, prefixlen, &buf);
if (!in_addr_equal(family, &masked, &addr))
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Specified address '%s' is not properly masked, assuming '%s'.", word, strna(buf));
}
"Specified address '%s' is not properly masked, assuming '%s'.",
word,
IN_ADDR_PREFIX_TO_STRING(family, &masked, prefixlen));
ipmask = new(WireguardIPmask, 1);
if (!ipmask)