]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_connmark.c
man: tc-taprio.8: fix syntax error
[mirror_iproute2.git] / tc / m_connmark.c
index 37d7185415490cb4ecdf8e88eba866066d5e3f6f..45e2d05f1a9114f7df37c88ee79a11e109390bf8 100644 (file)
@@ -95,10 +95,9 @@ parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
                }
        }
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, MAX_MSG, tca_id, NULL, 0);
+       tail = addattr_nest(n, MAX_MSG, tca_id);
        addattr_l(n, MAX_MSG, TCA_CONNMARK_PARMS, &sel, sizeof(sel));
-       tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail;
+       addattr_nest_end(n, tail);
 
        *argc_p = argc;
        *argv_p = argv;
@@ -115,15 +114,20 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
 
        parse_rtattr_nested(tb, TCA_CONNMARK_MAX, arg);
        if (tb[TCA_CONNMARK_PARMS] == NULL) {
-               fprintf(f, "[NULL connmark parameters]");
+               print_string(PRINT_FP, NULL, "%s", "[NULL connmark parameters]");
                return -1;
        }
 
        ci = RTA_DATA(tb[TCA_CONNMARK_PARMS]);
 
-       fprintf(f, " connmark zone %d\n", ci->zone);
-       fprintf(f, "\t index %u ref %d bind %d", ci->index,
-               ci->refcnt, ci->bindcnt);
+       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_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);
 
        if (show_stats) {
                if (tb[TCA_CONNMARK_TM]) {
@@ -132,7 +136,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
                        print_tm(f, tm);
                }
        }
-       fprintf(f, "\n");
+       print_string(PRINT_FP, NULL, "%s", _SL_);
 
        return 0;
 }