From: Phil Sutter Date: Wed, 2 Mar 2016 11:20:31 +0000 (+0100) Subject: tc: pedit: Fix retain value for ihl adjustments X-Git-Tag: v4.5.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=338b003bcc22a62c98b84dbe5e491cae84dbb03c;p=thirdparty%2Fiproute2.git tc: pedit: Fix retain value for ihl adjustments 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 --- diff --git a/tc/p_ip.c b/tc/p_ip.c index 08fdbaa41..10e4bebc7 100644 --- 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) {