Compile extended ack reporting only for kernel >= 4.12
Showing
-
Owner
No, detect at run-time rather than at compile-time. There's already a
kernel_older_than
function that you can use to set a global flag. -
Maintainer
Compilation fails on OBS for debian 9 because
NETLINK_EXT_ACK
for example is not defined so this is why I am detecting at compile-time. -
Maintainer
You mean define the macros that don't exist ? There is NETLINK_EXT_ACK, NLMSGERR_ATTR_MSG and NLM_F_ACK_TLVS, so we could define these three and then detect kernel verison at run-time
-
Owner
Ok, this conditionally revert d5369ea2: can you mention this in the commit message ?
I think you can simplify a little in 2 ways:
#define EXTENDED_ACK_REPORTING (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) ... #if EXTENDED_ACK_REPORTING ...
and have an empty
netlink_get_extack
when < 4.2:static int netlink_get_extack(struct nlmsghdr *nh, int len, int done) { #if EXTENDED_ACK_REPORTING ... #endif return 0; }
Please register or sign in to comment