From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CA02CA9EAE for ; Tue, 29 Oct 2019 17:54:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75C6B2086A for ; Tue, 29 Oct 2019 17:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726985AbfJ2Rya (ORCPT ); Tue, 29 Oct 2019 13:54:30 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:41035 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725830AbfJ2Rya (ORCPT ); Tue, 29 Oct 2019 13:54:30 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from vladbu@mellanox.com) with ESMTPS (AES256-SHA encrypted); 29 Oct 2019 19:54:10 +0200 Received: from reg-r-vrt-018-180.mtr.labs.mlnx. (reg-r-vrt-018-180.mtr.labs.mlnx [10.215.1.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x9THrmTJ001340; Tue, 29 Oct 2019 19:53:48 +0200 From: Vlad Buslov To: netdev@vger.kernel.org Cc: davem@davemloft.net, mleitner@redhat.com, paulb@mellanox.com, Vlad Buslov Subject: [PATCH iproute2 net] tc: remove duplicated NEXT_ARG_FWD() in parse_ct() Date: Tue, 29 Oct 2019 19:53:46 +0200 Message-Id: <20191029175346.14564-1-vladbu@mellanox.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Function parse_ct() manually calls NEXT_ARG_FWD() after parse_action_control_dflt(). This is redundant because parse_action_control_dflt() modifies argc and argv itself. Moreover, such implementation parses out any following actions option. For example, adding action ct with cookie errors: $ sudo tc actions add action ct cookie 111111111111 Bad action type 111111111111 Usage: ... gact [RAND] [INDEX] Where: ACTION := reclassify | drop | continue | pass | pipe | goto chain | jump RAND := random RANDTYPE := netrand | determ VAL : = value not exceeding 10000 JUMP_COUNT := Absolute jump from start of action list INDEX := index value used With fix: $ sudo tc actions add action ct cookie 111111111111 $ sudo tc actions list action ct total acts 1 action order 0: ct zone 0 pipe index 1 ref 1 bind 0 cookie 111111111111 Fixes: c8a494314c40 ("tc: Introduce tc ct action") Signed-off-by: Vlad Buslov --- tc/m_ct.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tc/m_ct.c b/tc/m_ct.c index 8589cb9a3c51..d79eb5e361ac 100644 --- a/tc/m_ct.c +++ b/tc/m_ct.c @@ -316,7 +316,6 @@ parse_ct(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_PIPE); - NEXT_ARG_FWD(); addattr16(n, MAX_MSG, TCA_CT_ACTION, ct_action); addattr_l(n, MAX_MSG, TCA_CT_PARMS, &sel, sizeof(sel)); -- 2.21.0