]> git.proxmox.com Git - mirror_iproute2.git/commit
tc: f_u32: allow skip_hw and skip_sw flags to be last
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 6 Nov 2018 03:23:27 +0000 (19:23 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 9 Nov 2018 16:12:29 +0000 (08:12 -0800)
commit9c5f4251d61d6e2f5072b239b0102b37c11286c7
tree2a36d0bad6944632e4890d973f3101c464905901
parent1a03ac6b051097d4cc648d56e2da4d11b702c686
tc: f_u32: allow skip_hw and skip_sw flags to be last

u32 uses NEXT_ARG() incorrectly when parsing skip_hw and skip_sw
flags.  NEXT_ARG() ensures there is another argument on the command
line, and is used in handling <keyword> <value> syntax to move past
<keyword> and ensure there is a <value> to read.

Commit 5e5b3008d1fb ("tc: f_u32: Add support for skip_hw and skip_sw
flags") seems to have copy pasted the handling from the previous
command - "police", which needs an extra parameter and is kind of
special due to the use of parse_police() helper.

The combination of NEXT_ARG() and continue worked fine as long as
skip_sw/skip_hw wasn't last, e.g.:

$ tc filter add dev dummy0 ingress prio 101 protocol ipv6 \
    u32 match ip6 priority 0xa0 0xe0 skip_hw action pass

But would fail if it was last:

$ tc filter add dev dummy0 ingress prio 101 protocol ipv6 \
    u32 match ip6 priority 0xa0 0xe0 flowid :1 skip_hw
Command line is not complete. Try option "help"

Remove the NEXT_ARG()s and the continues, and let the argc--; argv++;
at the end of the loop do its job.

Fixes: 5e5b3008d1fb ("tc: f_u32: Add support for skip_hw and skip_sw flags")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/f_u32.c