summaryrefslogtreecommitdiff
path: root/src/basic/missing.h
diff options
context:
space:
mode:
authorDaniel Dao <dqminh89@gmail.com>2018-02-26 14:33:16 +0000
committerDaniel Dao <dqminh89@gmail.com>2018-03-12 11:36:25 +0000
commitf02ba163891bab73a80332b4599a9d73083cb6c2 (patch)
tree6cb5850a946f469b9fe65b9bc8148fefe4cdb0f2 /src/basic/missing.h
parent332b0908370a1c5484df8084ea98743a25a24c50 (diff)
downloadsystemd-f02ba163891bab73a80332b4599a9d73083cb6c2.tar.gz
setup route expiration in kernel if supported
kernel >= 4.5 (with commit https://github.com/torvalds/linux/commit/32bc201e1974976b7d3fea9a9b17bb7392ca6394) supports RTA_EXPIRES netlink attribute to set router lifetime. This simply detect the kernel version (>=4.5) and set the lifetime properly, fallback to expiring route in userspace for kernel that doesnt support it. Signed-off-by: Daniel Dao <dqminh89@gmail.com>
Diffstat (limited to 'src/basic/missing.h')
-rw-r--r--src/basic/missing.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 1cc3f08e48..567aea8da9 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -1058,6 +1058,10 @@ struct input_mask {
#define RTAX_QUICKACK 15
#endif
+#ifndef RTA_EXPIRES
+#define RTA_EXPIRES 23
+#endif
+
#ifndef IPV6_UNICAST_IF
#define IPV6_UNICAST_IF 76
#endif