Actions
Bug #4741
openILB rule hash should consider IPv6 address as a hashing base
Start date:
2014-04-10
Due date:
% Done:
0%
Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:
Description
While working on 4735 I've observed ILB_RULE_HASH [which is used for looking up through ILB rules with VIP address as a search criteria] incorrectly assumes we could have IPv4 VIP addresses only:
/* addr is assumed to be a uint8_t * to an ipaddr_t. /
73#define ILB_RULE_HASH(addr, hash_size) \\
74 ((((addr) + 3) * 29791 + *((addr) + 2) * 961 + *((addr) + 1) * 31 + \\
75 *(addr)) & ((hash_size) - 1))
And so it looks like (uint8_t *)&vip->s6_addr323 in the case of IPv6 address.
As an example two unequal IP adresses like that:
2a02:a30:1:1::219
2a02:a30:2:1::219
will fall into the same HASH bucket thus HASH efficiency decreases to that of the list.
Actions