NetworkManager/shared/n-dhcp4
Thomas Haller f49ce41214 client: fallback to CLOCK_MONOTONIC for timerfd
RHEL7 supports clock_gettime(CLOCK_BOOTIME), but it does not support
timerfd_create(CLOCK_BOOTIME). Creating a timerfd will fail with EINVAL.
Fallback to CLOCK_MONOTONIC.

Compare this to n-acd which also has compatibility code to fallback to
CLOCK_MONOTONIC. However when n-acd falls back to CLOCK_MONOTONIC, it uses
monotonic clock also for clock_gettime().

For n-dhcp4, the timestamps are also exposed in the public API
(n_dhcp4_client_lease_get_lifetime()). Hence, for timestamps n-dhcp4
still uses and requires clock_gettime(CLOCK_BOOTIME). Only the internal
timeout handling with the timerfd falls back to CLOCK_MONOTONIC.

https://github.com/nettools/n-dhcp4/pull/13
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/362
(cherry picked from commit a1771c738d)
2019-12-15 13:51:44 +01:00
..
.cherryci Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00
src client: fallback to CLOCK_MONOTONIC for timerfd 2019-12-15 13:51:44 +01:00
subprojects Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00
.editorconfig Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00
.gitmodules Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00
.travis.yml n-dhcp4: ci: drop broken armv7hl 2019-11-20 10:50:17 +01:00
AUTHORS Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00
meson.build Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00
NEWS.md Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00
README.md Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4' 2019-05-25 02:02:04 +02:00

n-dhcp4

Dynamic Host Configuration Protocol for IPv4

The n-dhcp4 project implements the IPv4 Dynamic Host Configuration Protocol as defined in RFC-2132+.

Project

Requirements

The requirements for this project are:

  • Linux kernel >= 3.19
  • libc (e.g., glibc >= 2.16)

At build-time, the following software is required:

  • meson >= 0.41
  • pkg-config >= 0.29

Build

The meson build-system is used for this project. Contact upstream documentation for detailed help. In most situations the following commands are sufficient to build and install from source:

mkdir build
cd build
meson setup ..
ninja
meson test
ninja install

No custom configuration options are available.

Repository:

License:

  • Apache-2.0 OR LGPL-2.1-or-later
  • See AUTHORS file for details.