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>
This commit is contained in:
Daniel Dao
2018-03-12 11:36:25 +00:00
parent 332b090837
commit f02ba16389
6 changed files with 41 additions and 3 deletions
+4
View File
@@ -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