From: Yu Watanabe Date: Thu, 9 Dec 2021 06:23:32 +0000 (+0900) Subject: network: address: also adjust scope when address is link local address X-Git-Tag: v250-rc1~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20228b6d9630b953fdc0863b669dce1fad647d68;p=thirdparty%2Fsystemd.git network: address: also adjust scope when address is link local address But again only when Scope= is not explicitly specified. --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index f9d21af1581..618c278abfc 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1916,8 +1916,12 @@ static int address_section_verify(Address *address) { address->label = mfree(address->label); } - if (!address->scope_set && in_addr_is_localhost(address->family, &address->in_addr) > 0) - address->scope = RT_SCOPE_HOST; + if (!address->scope_set) { + if (in_addr_is_localhost(address->family, &address->in_addr) > 0) + address->scope = RT_SCOPE_HOST; + else if (in_addr_is_link_local(address->family, &address->in_addr) > 0) + address->scope = RT_SCOPE_LINK; + } if (address->family == AF_INET6 && !FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV6))