-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rtnl): Add Linux kernel version check for IFA_RT_PRIORITY
This commit adds a version check for the IFA_RT_PRIORITY constant, which was introduced in Linux kernel 4.18. The constant is now only defined if the kernel version is greater than 4.17.0. Signed-off-by: Jianhui Zhao <[email protected]>
- Loading branch information
Showing
2 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
* Author: Jianhui Zhao <[email protected]> | ||
*/ | ||
|
||
#include <linux/version.h> | ||
#include <linux/rtnetlink.h> | ||
#include <linux/if.h> | ||
|
||
|
@@ -289,7 +290,10 @@ int luaopen_eco_rtnl(lua_State *L) | |
lua_add_constant(L, "IFA_CACHEINFO", IFA_CACHEINFO); | ||
lua_add_constant(L, "IFA_MULTICAST", IFA_MULTICAST); | ||
lua_add_constant(L, "IFA_FLAGS", IFA_FLAGS); | ||
|
||
#if LINUX_VERSION_CODE > KERNEL_VERSION(4,17,0) | ||
lua_add_constant(L, "IFA_RT_PRIORITY", IFA_RT_PRIORITY); | ||
#endif | ||
|
||
lua_add_constant(L, "RTNLGRP_LINK", RTNLGRP_LINK); | ||
lua_add_constant(L, "RTNLGRP_NOTIFY", RTNLGRP_NOTIFY); | ||
|