]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_connmark.c
tc: skip actions that don't have options attribute when printing
[mirror_iproute2.git] / tc / m_connmark.c
index af5ebfc4e40bfda58572ad4a7179f63404903dd4..640bba9da18e61d8764853d59e3013ccda892080 100644 (file)
@@ -110,22 +110,22 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
        struct rtattr *tb[TCA_CONNMARK_MAX + 1];
        struct tc_connmark *ci;
 
+       print_string(PRINT_ANY, "kind", "%s ", "connmark");
        if (arg == NULL)
-               return -1;
+               return 0;
 
        parse_rtattr_nested(tb, TCA_CONNMARK_MAX, arg);
        if (tb[TCA_CONNMARK_PARMS] == NULL) {
-               print_string(PRINT_FP, NULL, "%s", "[NULL connmark parameters]");
+               fprintf(stderr, "Missing connmark parameters\n");
                return -1;
        }
 
        ci = RTA_DATA(tb[TCA_CONNMARK_PARMS]);
 
-       print_string(PRINT_ANY, "kind", "%s ", "connmark");
        print_uint(PRINT_ANY, "zone", "zone %u", ci->zone);
        print_action_control(f, " ", ci->action, "");
 
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
        print_uint(PRINT_ANY, "index", "\t index %u", ci->index);
        print_int(PRINT_ANY, "ref", " ref %d", ci->refcnt);
        print_int(PRINT_ANY, "bind", " bind %d", ci->bindcnt);
@@ -137,7 +137,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
                        print_tm(f, tm);
                }
        }
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
 
        return 0;
 }