IPv6 RA: Support the Retrans Timer field (IPv6 Conformance Test: v6LC.2.1.5)
The RA's Retransmission Timer field was being ignored. This resolves the IPv6
Core Conformance test, v6LC.2.1.5 [1].
Retransmission Timer is a 32-bit unsigned integer. The time, in milliseconds,
between retransmitted Neighbor Solicitation messages. Used by the Address
Resolution and Neighbor Unreachability Detection (NUD) algorithm.
Support setting a default value for the neighbour retransmission timer value with:
[Network]
IPv6RetransmissionTimeSec=<int>
By default, upon receiving a Router Advertisement with the Retransmission Timer
field set to a non-zero value, it will update the kernel's retransmit timer value.
To disable this behaviour, configure the UseIPv6RetransmissionTime= under the
[IPv6AcceptRA] section.
[IPv6AcceptRA]
UseIPv6RetransmissionTime=<bool>
RFC4861: Neighbor Discovery in IPv6
* Section 4.2 RA Message Format.
* Section 6.3.4 Processing Received Router Advertisements
A Router Advertisement field (e.g., Cur Hop Limit, Reachable Time,
and Retrans Timer) may contain a value denoting that it is
unspecified. In such cases, the parameter should be ignored and the
host should continue using whatever value it is already using. In
particular, a host MUST NOT interpret the unspecified value as
meaning change back to the default value that was in use before the
first Router Advertisement was received.
The RetransTimer variable SHOULD be copied from the Retrans Timer
field, if the received value is non-zero.
References
[1] IPv6 Core Conformance Spec (PDF)
This commit is contained in:
committed by
Yu Watanabe
parent
afd08d7740
commit
d4c8de21a0
@@ -96,6 +96,26 @@ int sysctl_write_ip_property(int af, const char *ifname, const char *property, c
|
||||
return sysctl_write(p, value);
|
||||
}
|
||||
|
||||
int sysctl_write_ip_neighbor_property(int af, const char *ifname, const char *property, const char *value) {
|
||||
const char *p;
|
||||
|
||||
assert(property);
|
||||
assert(value);
|
||||
assert(ifname);
|
||||
|
||||
if (!IN_SET(af, AF_INET, AF_INET6))
|
||||
return -EAFNOSUPPORT;
|
||||
|
||||
if (ifname) {
|
||||
if (!ifname_valid_full(ifname, IFNAME_VALID_SPECIAL))
|
||||
return -EINVAL;
|
||||
p = strjoina("net/", af_to_ipv4_ipv6(af), "/neigh/", ifname, "/", property);
|
||||
} else
|
||||
p = strjoina("net/", af_to_ipv4_ipv6(af), "/neigh/default/", property);
|
||||
|
||||
return sysctl_write(p, value);
|
||||
}
|
||||
|
||||
int sysctl_read(const char *property, char **ret) {
|
||||
char *p;
|
||||
int r;
|
||||
|
||||
Reference in New Issue
Block a user