]> git.proxmox.com Git - ovs.git/commitdiff
compat: Add compat fix for old kernels
authorRoi Dayan <roid@mellanox.com>
Wed, 6 Nov 2019 07:34:46 +0000 (09:34 +0200)
committerSimon Horman <simon.horman@netronome.com>
Mon, 11 Nov 2019 10:46:53 +0000 (11:46 +0100)
In kernels older than 4.8, struct tcf_t didn't have the firstuse.
If openvswitch is compiled with the compat pkt_cls.h then there is
a struct size mismatch between openvswitch and the kernel which cause
parsing netlink actions to fail.
After this commit parsing the netlink actions pass even if compiled with
the compat pkt_cls.h.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
acinclude.m4
include/linux/pkt_cls.h

index a0507cfe019ee0cc1b3b5d15fe170a1ef1ebd5aa..bc5b1c667eff4d4d0fb6e681ac2b48e0aef14f6a 100644 (file)
@@ -185,6 +185,8 @@ AC_DEFUN([OVS_CHECK_LINUX_TC], [
     [AC_DEFINE([HAVE_TCA_FLOWER_KEY_ENC_IP_TTL_MASK], [1],
                [Define to 1 if TCA_FLOWER_KEY_ENC_IP_TTL_MASK is available.])])
 
+  AC_CHECK_MEMBERS([struct tcf_t.firstuse], [], [], [#include <linux/pkt_cls.h>])
+
   AC_COMPILE_IFELSE([
     AC_LANG_PROGRAM([#include <linux/tc_act/tc_vlan.h>], [
         int x = TCA_VLAN_PUSH_VLAN_PRIORITY;
index 4adea59e7c36fecdb9824a07a8c6e6cbaf704f31..2f7e328c48c8b2545aee3f4bedbc5f1d495b44c2 100644 (file)
@@ -64,7 +64,9 @@ struct tcf_t {
        __u64   install;
        __u64   lastuse;
        __u64   expires;
+#ifdef HAVE_STRUCT_TCF_T_FIRSTUSE
        __u64   firstuse;
+#endif
 };
 
 #define tc_gen \