]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/f_flow.c
Merge ../iproute2-next
[mirror_iproute2.git] / tc / f_flow.c
index b15710497d1244fe3cac97d8bc282c28f07d0132..9dd50df2e49212277a8f5fc9bc3609dc17d83b63 100644 (file)
 static void explain(void)
 {
        fprintf(stderr,
-"Usage: ... flow ...\n"
-"\n"
-" [mapping mode]: map key KEY [ OPS ] ...\n"
-" [hashing mode]: hash keys KEY-LIST ... [ perturb SECS ]\n"
-"\n"
-"                 [ divisor NUM ] [ baseclass ID ] [ match EMATCH_TREE ]\n"
-"                 [ action ACTION_SPEC ]\n"
-"\n"
-"KEY-LIST := [ KEY-LIST , ] KEY\n"
-"KEY      := [ src | dst | proto | proto-src | proto-dst | iif | priority |\n"
-"              mark | nfct | nfct-src | nfct-dst | nfct-proto-src |\n"
-"              nfct-proto-dst | rt-classid | sk-uid | sk-gid |\n"
-"              vlan-tag | rxhash ]\n"
-"OPS      := [ or NUM | and NUM | xor NUM | rshift NUM | addend NUM ]\n"
-"ID       := X:Y\n"
+               "Usage: ... flow ...\n"
+               "\n"
+               " [mapping mode]: map key KEY [ OPS ] ...\n"
+               " [hashing mode]: hash keys KEY-LIST ... [ perturb SECS ]\n"
+               "\n"
+               "                 [ divisor NUM ] [ baseclass ID ] [ match EMATCH_TREE ]\n"
+               "                 [ action ACTION_SPEC ]\n"
+               "\n"
+               "KEY-LIST := [ KEY-LIST , ] KEY\n"
+               "KEY      := [ src | dst | proto | proto-src | proto-dst | iif | priority |\n"
+               "              mark | nfct | nfct-src | nfct-dst | nfct-proto-src |\n"
+               "              nfct-proto-dst | rt-classid | sk-uid | sk-gid |\n"
+               "              vlan-tag | rxhash ]\n"
+               "OPS      := [ or NUM | and NUM | xor NUM | rshift NUM | addend NUM ]\n"
+               "ID       := X:Y\n"
        );
 }
 
@@ -147,8 +147,7 @@ static int flow_parse_opt(struct filter_util *fu, char *handle,
                }
        }
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
+       tail = addattr_nest(n, 4096, TCA_OPTIONS);
 
        while (argc > 0) {
                if (matches(*argv, "map") == 0) {
@@ -259,7 +258,7 @@ static int flow_parse_opt(struct filter_util *fu, char *handle,
                addattr32(n, 4096, TCA_FLOW_XOR, xor);
        }
 
-       tail->rta_len = (void *)NLMSG_TAIL(n) - (void *)tail;
+       addattr_nest_end(n, tail);
        return 0;
 }