]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: pedit: Fix retain value for ihl adjustments
authorPhil Sutter <phil@nwl.cc>
Wed, 2 Mar 2016 11:20:31 +0000 (12:20 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 6 Mar 2016 20:53:11 +0000 (12:53 -0800)
Since the IP Header Length field is just half a byte, adjust retain to
only match these bits so the Version field is not overwritten by
accident.

The whole concept is actually broken due to dependency on endianness
which pedit ignores.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tc/p_ip.c

index 08fdbaa41fbf41346dccca3bcf4ca9161648c9b5..10e4bebc71d942bc5e1fc91a9d5757a5b7ec47e6 100644 (file)
--- a/tc/p_ip.c
+++ b/tc/p_ip.c
@@ -58,7 +58,7 @@ parse_ip(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_ke
        if (strcmp(*argv, "ihl") == 0) {
                NEXT_ARG();
                tkey->off = 0;
-               res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey);
+               res = parse_cmd(&argc, &argv, 1, TU32,0x0f,sel,tkey);
                goto done;
        }
        if (strcmp(*argv, "protocol") == 0) {