diff options
author | Thomas Haller <thaller@redhat.com> | 2017-12-11 09:42:14 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2017-12-11 10:30:27 +0100 |
commit | e40114d356c4c0b0e24ba5d391cdfb24aa355c55 (patch) | |
tree | b4fa85c6465ea108736e92f69cf431374e72b951 | |
parent | 7d044a3ef7c868b47a80f58ee923c35e7fd3f1fd (diff) | |
download | NetworkManager-lr/th/tc.tar.gz |
platform: fix build for missing <linux/tc_act/tc_defact.h> headerlr/th/tc
<linux/tc_act/tc_defact.h> was moved to user-space API only in 2013
by commit 5bc3db5c9ca8407f52918b6504d3b27230defedc. Our travis CI currently
fails to build due to that.
Re-implement the header.
-rw-r--r-- | src/platform/nm-linux-platform.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 268276d1cf..f2acf67dff 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -36,7 +36,6 @@ #include <linux/if_link.h> #include <linux/if_tun.h> #include <linux/if_tunnel.h> -#include <linux/tc_act/tc_defact.h> #include <netlink/netlink.h> #include <netlink/msg.h> #include <libudev.h> @@ -55,6 +54,29 @@ #include "nm-utils/unaligned.h" #include "nm-utils/nm-udev-utils.h" +/*****************************************************************************/ + +/* re-implement <linux/tc_act/tc_defact.h> to build against kernel + * headers that lack this. */ + +#include <linux/pkt_cls.h> + +struct tc_defact { + tc_gen; +}; + +enum { + TCA_DEF_UNSPEC, + TCA_DEF_TM, + TCA_DEF_PARMS, + TCA_DEF_DATA, + TCA_DEF_PAD, + __TCA_DEF_MAX +}; +#define TCA_DEF_MAX (__TCA_DEF_MAX - 1) + +/*****************************************************************************/ + #define VLAN_FLAG_MVRP 0x8 /* nm-internal error codes for libnl. Make sure they don't overlap. */ @@ -2923,7 +2945,7 @@ _add_action_simple (struct nl_msg *msg, if (!(act_options = nla_nest_start (msg, TCA_ACT_OPTIONS))) goto nla_put_failure; - NLA_PUT (msg, TCA_DEF_PARMS, sizeof(sel), &sel); + NLA_PUT (msg, TCA_DEF_PARMS, sizeof (sel), &sel); NLA_PUT_STRING (msg, TCA_DEF_DATA, simple->sdata); nla_nest_end (msg, act_options); |