From 25e7b99cc450490c38becb03d8bddd0199cfd3f9 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 6 Jul 2023 10:26:39 +0200 Subject: netlink_linearize: use div_round_up in byteorder length Use div_round_up() to calculate the byteorder length, otherwise fields that take % BITS_PER_BYTE != 0 are not considered by the byteorder expression. Reported-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- tests/py/ip6/meta.t.payload | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/py/ip6/meta.t.payload') diff --git a/tests/py/ip6/meta.t.payload b/tests/py/ip6/meta.t.payload index f0507dc4..379a9c13 100644 --- a/tests/py/ip6/meta.t.payload +++ b/tests/py/ip6/meta.t.payload @@ -66,7 +66,7 @@ ip6 test-ip6 input [ payload load 2b @ network header + 0 => reg 1 ] [ bitwise reg 1 = ( reg 1 & 0x0000c00f ) ^ 0x00000000 ] [ bitwise reg 1 = ( reg 1 >> 0x00000006 ) ] - [ byteorder reg 1 = ntoh(reg 1, 2, 1) ] + [ byteorder reg 1 = ntoh(reg 1, 2, 2) ] [ bitwise reg 1 = ( reg 1 << 0x00000002 ) ] [ bitwise reg 1 = ( reg 1 & 0xffffffef ) ^ 0x00000010 ] [ meta set mark with reg 1 ] @@ -76,7 +76,7 @@ ip6 test-ip6 input [ payload load 2b @ network header + 0 => reg 1 ] [ bitwise reg 1 = ( reg 1 & 0x0000c00f ) ^ 0x00000000 ] [ bitwise reg 1 = ( reg 1 >> 0x00000006 ) ] - [ byteorder reg 1 = ntoh(reg 1, 2, 1) ] + [ byteorder reg 1 = ntoh(reg 1, 2, 2) ] [ bitwise reg 1 = ( reg 1 << 0x0000001a ) ] [ bitwise reg 1 = ( reg 1 & 0xffffffef ) ^ 0x00000010 ] [ meta set mark with reg 1 ] -- cgit v1.2.3