diff options
author | Susant Sahani <susant@redhat.com> | 2017-09-26 12:54:26 +0200 |
---|---|---|
committer | Susant Sahani <susant@redhat.com> | 2017-09-26 12:54:26 +0200 |
commit | b7ed5384ab55cd4d7b8d7d1ec7f5d5e145f0a2b1 (patch) | |
tree | d3d595385b9af3f87f5f1f7337af3775c25bd61f | |
parent | journal-verfiy: add a couple of missing le64toh() calls (#6888) (diff) | |
download | systemd-b7ed5384ab55cd4d7b8d7d1ec7f5d5e145f0a2b1.tar.xz systemd-b7ed5384ab55cd4d7b8d7d1ec7f5d5e145f0a2b1.zip |
networkd: Do not treat IPv6 addresses IFA_F_DEPRECATED as not ready.
When we are receiving address lifetime valid and lifetime preferred
'0' we set them via ndisc. That makes is shows as depricated and we
treat this as not ready.
In link_check_ready we look for whether address is depricated and
since this is depricated we never configure this link.
Thanks to Marc Haber <mh+github@zugschlus.de>
lifetime 0 a valid, and common, use case. It enables an installation to
autoconfigure systems in a way that they become immediately reachable
without needing local configuration after they have been turned on (for
example, for remote configuration). The local admin can then configure
additional, static IP addresses to be used for the server's service (and
the IP adress _only_, while the rest of network configuration still comes
from autoconfiguration), while _KEEPING_ the possibiltiy to reach the
system over the autoconfigured address in the case that static
configuration fails.
The correct way is to handle the announcement exactly as it is correctly
handled in the released software: It configures the address as
"deprecated", causing the kernel to accept packets addresses to it, and
not to use it for outgoing packets/connections _UNLESS_ there is no other
way to send the packet out.
The only change that is needed is that systemd-networkd should not wedge
itself in that case, it should just continue working (with two IP
addresses configured on the interface).
An IPv6 address with a remamining lifetime of zero is _NOT_ like an
expired IPv4 DHCP lease, it's still a valid and useable IP address. It
is just that the network advises the host not to use the address any
more for outgoing traffic _UNLESS_ there is no other way to send the
traffic.
Fixes #6359
-rw-r--r-- | src/network/networkd-address.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 7f536b4ba9..889ff1ec16 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -973,7 +973,10 @@ int config_parse_address_scope(const char *unit, bool address_is_ready(const Address *a) { assert(a); - return !(a->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED)); + if (a->family == AF_INET6) + return !(a->flags & IFA_F_TENTATIVE); + else + return !(a->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED)); } int config_parse_router_preference(const char *unit, |