[PATCH] act: fix policy range check

Cong Wang xiyou.wangcong at gmail.com
Fri Apr 4 18:15:16 PDT 2014


mirred action should accept all TC_ACT* policy

Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
---
 lib/route/act/mirred.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/route/act/mirred.c b/lib/route/act/mirred.c
index 2668048..d047e24 100644
--- a/lib/route/act/mirred.c
+++ b/lib/route/act/mirred.c
@@ -187,7 +187,7 @@ int rtnl_mirred_set_policy(struct rtnl_act *act, int policy)
 	if (!(u = (struct rtnl_mirred *) rtnl_tc_data(TC_CAST(act))))
 		return -NLE_NOMEM;
 
-	if (policy > TC_POLICE_PIPE || policy < TC_POLICE_OK)
+	if (policy > TC_ACT_REPEAT || policy < TC_ACT_OK)
 		return -NLE_INVAL;
 
 	switch (u->m_parm.eaction) {
-- 
1.7.11.7




More information about the libnl mailing list