Skip to content

Commit 7345125

Browse files
Yulia Kartsevashemminger
authored andcommitted
tc: fix ipv6 filter selector attribute for some prefix lengths
Wrong TCA_U32_SEL attribute packing if prefixLen AND 0x1f equals 0x1f. These are /31, /63, /95 and /127 prefix lengths. Example: ip6 dst face:b00f::/31 filter parent b: protocol ipv6 pref 2307 u32 filter parent b: protocol ipv6 pref 2307 u32 fh 800: ht divisor 1 filter parent b: protocol ipv6 pref 2307 u32 fh 800::800 order 2048 key ht 800 bkt 0 match faceb00f/ffffffff at 24 v2: previous patch was made with a wrong repo Signed-off-by: Yulia Kartseva <hex@fb.com>
1 parent e413926 commit 7345125

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tc/f_u32.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ static int parse_ip6_addr(int *argc_p, char ***argv_p,
385385

386386
plen = addr.bitlen;
387387
for (i = 0; i < plen; i += 32) {
388-
/* if (((i + 31) & ~0x1F) <= plen) { */
389-
if (i + 31 <= plen) {
388+
if (i + 31 < plen) {
390389
res = pack_key(sel, addr.data[i / 32],
391390
0xFFFFFFFF, off + 4 * (i / 32), offmask);
392391
if (res < 0)

0 commit comments

Comments
 (0)