Skip to content

Commit

Permalink
compat: Add compat fix for old kernels
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
roidayan authored and shorman-netronome committed Nov 11, 2019
1 parent 9ff24b9 commit c0a1df2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions include/linux/pkt_cls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit c0a1df2

Please sign in to comment.