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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user