mirror of
https://github.com/MariaDB/server.git
synced 2025-12-28 08:10:14 +00:00
MDEV-19669 - fix matching CIDR address for proxy protocol.
Prior to this fix, when matching addresses using mask, extra bits could be used for comparison, e.g to match with "a.b.c.d/24" , 27 bits were compared rather than 24. The patch fixes the calculation.
This commit is contained in:
parent
3fc1f6260f
commit
584ffa02f1
@ -470,7 +470,7 @@ static int compare_bits(const void *s1, const void *s2, int bit_count)
|
||||
int byte_count= bit_count / 8;
|
||||
if (byte_count && (result= memcmp(s1, s2, byte_count)))
|
||||
return result;
|
||||
int rem= byte_count % 8;
|
||||
int rem= bit_count % 8;
|
||||
if (rem)
|
||||
{
|
||||
// compare remaining bits i.e partial bytes.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user