mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
Merge pull request #19947 from yuwata/network-dad-tiny-fixes
network: tiny fixes about IPv4ACD
This commit is contained in:
commit
aeffa4c3ed
@ -1098,8 +1098,8 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
|
||||
<listitem>
|
||||
<para>Takes one of <literal>ipv4</literal>, <literal>ipv6</literal>,
|
||||
<literal>both</literal>, <literal>none</literal>. When <literal>ipv4</literal>,
|
||||
performs IPv4 Duplicate Address Detection. See
|
||||
<ulink url="https://tools.ietf.org/html/rfc5227">RFC 5224</ulink>.
|
||||
performs IPv4 Address Conflict Detection. See
|
||||
<ulink url="https://tools.ietf.org/html/rfc5227">RFC 5227</ulink>.
|
||||
When <literal>ipv6</literal>, performs IPv6 Duplicate Address Detection. See
|
||||
<ulink url="https://tools.ietf.org/html/rfc4862">RFC 4862</ulink>.
|
||||
Defaults to <literal>ipv6</literal>.</para>
|
||||
|
@ -2111,9 +2111,17 @@ static int address_section_verify(Address *address) {
|
||||
address->scope = RT_SCOPE_HOST;
|
||||
}
|
||||
|
||||
if (!FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV6))
|
||||
if (address->family == AF_INET6 &&
|
||||
!FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV6))
|
||||
address->flags |= IFA_F_NODAD;
|
||||
|
||||
if (address->family == AF_INET && in4_addr_is_link_local(&address->in_addr.in) &&
|
||||
!FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV4)) {
|
||||
log_debug("%s: An IPv4 link-local address is specified, enabling IPv4 Address Conflict Detection (ACD).",
|
||||
address->section->filename);
|
||||
address->duplicate_address_detection |= ADDRESS_FAMILY_IPV4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user