]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_connmark.c
tc: fix parsing of the control action
[mirror_iproute2.git] / tc / m_connmark.c
index 143d75de66b8b01b02cd0cf68787dcec7054a566..37d7185415490cb4ecdf8e88eba866066d5e3f6f 100644 (file)
@@ -30,7 +30,8 @@ explain(void)
        fprintf(stderr, "Usage: ... connmark [zone ZONE] [CONTROL] [index <INDEX>]\n");
        fprintf(stderr, "where :\n"
                "\tZONE is the conntrack zone\n"
-               "\tCONTROL := reclassify|pipe|drop|continue|ok\n");
+               "\tCONTROL := reclassify | pipe | drop | continue | ok |\n"
+               "\t           goto chain <CHAIN_INDEX>\n");
 }
 
 static void
@@ -80,32 +81,7 @@ parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
                }
        }
 
-       sel.action = TC_ACT_PIPE;
-       if (argc) {
-               if (matches(*argv, "reclassify") == 0) {
-                       sel.action = TC_ACT_RECLASSIFY;
-                       argc--;
-                       argv++;
-               } else if (matches(*argv, "pipe") == 0) {
-                       sel.action = TC_ACT_PIPE;
-                       argc--;
-                       argv++;
-               } else if (matches(*argv, "drop") == 0 ||
-                          matches(*argv, "shot") == 0) {
-                       sel.action = TC_ACT_SHOT;
-                       argc--;
-                       argv++;
-               } else if (matches(*argv, "continue") == 0) {
-                       sel.action = TC_ACT_UNSPEC;
-                       argc--;
-                       argv++;
-               } else if (matches(*argv, "pass") == 0 ||
-                          matches(*argv, "ok") == 0) {
-                       sel.action = TC_ACT_OK;
-                       argc--;
-                       argv++;
-               }
-       }
+       parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_PIPE);
 
        if (argc) {
                if (matches(*argv, "index") == 0) {
@@ -146,7 +122,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
        ci = RTA_DATA(tb[TCA_CONNMARK_PARMS]);
 
        fprintf(f, " connmark zone %d\n", ci->zone);
-       fprintf(f, "\t index %d ref %d bind %d", ci->index,
+       fprintf(f, "\t index %u ref %d bind %d", ci->index,
                ci->refcnt, ci->bindcnt);
 
        if (show_stats) {