]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-ndisc.c
network: address: use usec_t for handling lifetime 21072/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Oct 2021 17:21:59 +0000 (02:21 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Oct 2021 11:58:15 +0000 (20:58 +0900)
commit16bc8635d551f73cdd9cf5c9d452f3ad9c34e9e4
treed5343f31efce20403ff0759404f9e604eeb74500
parent03ccc4b423b8659d3724829930fc511c420277f4
network: address: use usec_t for handling lifetime

This drops stuct ifa_cacheinfo from Address, and store lifetime with
usec_t.

Why? Now, all requests of address configurations are once stored in
the request queue, and will be processed when it is ready. So, the
timestamp value passed to the kernel must be evaluated on configure.

This also fixes the following two issues.
- Time values in struct ifa_cacheinfo are stored in uint32_t.
  So, the validity check of the address configured by NDisc may fail on
  long running systems.
- If a system uses DHCPv6PD, when an interface may appear or be
  reconfigured later, then the lifetime value may be inappropriate.
  We need to adjust the lifetime with the current time and the timestamp
  of the lease.
src/network/networkd-address.c
src/network/networkd-address.h
src/network/networkd-dhcp4.c
src/network/networkd-dhcp6.c
src/network/networkd-ndisc.c
src/network/networkd-radv.c
src/network/networkd-radv.h
src/network/test-networkd-address.c