From: Yu Watanabe Date: Fri, 7 Jul 2023 02:31:25 +0000 (+0900) Subject: network: ignore Broadcast= setting when the address is null X-Git-Tag: v254-rc2~69^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0acc6470107bddc2afbd6d1011915142c1da6b74;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index d393d3374b0..e0a7b1c169f 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -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;