From 7f1a4a36ce17d74387a9075a710409c3dae1ab23 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czarnota Date: Fri, 11 Sep 2020 17:13:07 +0200 Subject: [16/17] gact: allow all TC_ACT_* actions --- include/linux-private/linux/pkt_cls.h | 10 +++++++++- lib/route/act/gact.c | 14 +------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/linux-private/linux/pkt_cls.h b/include/linux-private/linux/pkt_cls.h index 1152e67..c7bed3d 100644 --- a/include/linux-private/linux/pkt_cls.h +++ b/include/linux-private/linux/pkt_cls.h @@ -106,7 +106,15 @@ enum { #define TC_ACT_STOLEN 4 #define TC_ACT_QUEUED 5 #define TC_ACT_REPEAT 6 -#define TC_ACT_JUMP 0x10000000 +#define TC_ACT_REDIRECT 7 +#define TC_ACT_TRAP 8 /* For hw path, this means "trap to cpu" + * and don't further process the frame + * in hardware. For sw path, this is + * equivalent of TC_ACT_STOLEN - drop + * the skb and act like everything + * is alright. + */ +#define TC_ACT_VALUE_MAX TC_ACT_TRAP /* Action type identifiers*/ enum { diff --git a/lib/route/act/gact.c b/lib/route/act/gact.c index e37ef9f..159eace 100644 --- a/lib/route/act/gact.c +++ b/lib/route/act/gact.c @@ -126,19 +126,7 @@ int rtnl_gact_set_action(struct rtnl_act *act, int action) if (!(u = (struct rtnl_gact *) rtnl_tc_data(TC_CAST(act)))) return -NLE_NOMEM; - if (action > TC_ACT_SHOT || action < TC_ACT_UNSPEC) - return -NLE_INVAL; - - switch (action) { - case TC_ACT_UNSPEC: - case TC_ACT_SHOT: - u->g_parm.action = action; - break; - case TC_ACT_OK: - case TC_ACT_RECLASSIFY: - default: - return NLE_OPNOTSUPP; - } + u->g_parm.action = action; return 0; } -- 2.17.1