]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: ignore Broadcast= setting when the address is null
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Jul 2023 02:31:25 +0000 (11:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Jul 2023 10:11:37 +0000 (19:11 +0900)
When an address is requested with null address, then broadcast should be
determined after an address aquired that will be assigned to the
interface.

src/network/networkd-address.c

index d393d3374b096f9e9da7abe9f8fe192d068523b1..e0a7b1c169f67b23574bb53aa7a9a8db09e10be9 100644 (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;