summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-02-23 23:13:31 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-02-23 23:13:31 +0100
commit9472be2614d6acfcd058f8b7fef23c2bba10774b (patch)
tree17dc258fd6d47c7cb83675533fb8f10eb9063f57 /src
parentnetwork: set broadcast address on request (diff)
downloadsystemd-9472be2614d6acfcd058f8b7fef23c2bba10774b.tar.xz
systemd-9472be2614d6acfcd058f8b7fef23c2bba10774b.zip
network: use address_set_broadcast() at one more place
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-dhcp4.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index 4f37491e96..2b985f361a 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -925,8 +925,7 @@ static int dhcp4_request_address(Link *link, bool announce) {
addr->lifetime_preferred_usec = lifetime_usec;
addr->lifetime_valid_usec = lifetime_usec;
addr->prefixlen = prefixlen;
- if (prefixlen <= 30)
- addr->broadcast.s_addr = address.s_addr | ~netmask.s_addr;
+ address_set_broadcast(addr, link);
SET_FLAG(addr->flags, IFA_F_NOPREFIXROUTE, !link_prefixroute(link));
addr->route_metric = link->network->dhcp_route_metric;
addr->duplicate_address_detection = link->network->dhcp_send_decline ? ADDRESS_FAMILY_IPV4 : ADDRESS_FAMILY_NO;