network: ignore Broadcast= setting when the address is null

When an address is requested with null address, then broadcast should be
determined after an address aquired that will be assigned to the
interface.
This commit is contained in:
Yu Watanabe
2023-07-07 19:11:37 +09:00
parent 9a45125ae7
commit 0acc647010
+4
View File
@@ -2091,6 +2091,10 @@ static void address_section_adjust_broadcast(Address *address) {
log_warning("%s: broadcast address is set for an IPv4 address with peer address. "
"Ignoring Broadcast= setting in the [Address] section from line %u.",
address->section->filename, address->section->line);
else if (!in4_addr_is_set(&address->in_addr.in))
log_warning("%s: broadcast address is set for an IPv4 address with null address. "
"Ignoring Broadcast= setting in the [Address] section from line %u.",
address->section->filename, address->section->line);
else
/* Otherwise, keep the specified broadcast address. */
return;