lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 19 Jan 2024 16:02:52 +0100
From: Thomas Devoogdt <thomas@...oogdt.com>
To: netdev@...r.kernel.org
Cc: Thomas Devoogdt <thomas.devoogdt@...co.com>
Subject: [PATCH] tc: {m_gate,q_etf,q_taprio}.c: fix compilation with older glibc versions

glibc < 2.14 does not define CLOCK_BOOTTIME
glibc < 2.21 does not define CLOCK_TAI

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@...co.com>
---
 tc/m_gate.c   | 4 ++++
 tc/q_etf.c    | 4 ++++
 tc/q_taprio.c | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/tc/m_gate.c b/tc/m_gate.c
index c091ae19..1dacd4b3 100644
--- a/tc/m_gate.c
+++ b/tc/m_gate.c
@@ -26,8 +26,12 @@ static const struct clockid_table {
 	clockid_t clockid;
 } clockt_map[] = {
 	{ "REALTIME", CLOCK_REALTIME },
+#ifdef CLOCK_TAI
 	{ "TAI", CLOCK_TAI },
+#endif
+#ifdef CLOCK_BOOTTIME
 	{ "BOOTTIME", CLOCK_BOOTTIME },
+#endif
 	{ "MONOTONIC", CLOCK_MONOTONIC },
 	{ NULL }
 };
diff --git a/tc/q_etf.c b/tc/q_etf.c
index 572e2bc8..041d72ce 100644
--- a/tc/q_etf.c
+++ b/tc/q_etf.c
@@ -25,8 +25,12 @@ static const struct static_clockid {
 	clockid_t clockid;
 } clockids_sysv[] = {
 	{ "REALTIME", CLOCK_REALTIME },
+#ifdef CLOCK_TAI
 	{ "TAI", CLOCK_TAI },
+#endif
+#ifdef CLOCK_BOOTTIME
 	{ "BOOTTIME", CLOCK_BOOTTIME },
+#endif
 	{ "MONOTONIC", CLOCK_MONOTONIC },
 	{ NULL }
 };
diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index ef8fc7a0..c82bede1 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -35,8 +35,12 @@ static const struct static_clockid {
 	clockid_t clockid;
 } clockids_sysv[] = {
 	{ "REALTIME", CLOCK_REALTIME },
+#ifdef CLOCK_TAI
 	{ "TAI", CLOCK_TAI },
+#endif
+#ifdef CLOCK_BOOTTIME
 	{ "BOOTTIME", CLOCK_BOOTTIME },
+#endif
 	{ "MONOTONIC", CLOCK_MONOTONIC },
 	{ NULL }
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ