3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

ip-pool: Make host address valid even if prefix_len != 24

At the end of ip_pool_select_addr4() we'd check if the selected address
is equal to the subnet address and increment it by 1 to produce a valid
host address for the AP.  That check was always correct only with 24-bit
prefix, extend it to actually use the prefix-dependent mask instead of
0xff.  Fixes a testAP failure triggered 50% of the times because the
netmask is 28 bit long there.
This commit is contained in:
Andrew Zaborowski 2021-06-07 23:26:26 +02:00 committed by Denis Kenzior
parent de83176b04
commit b1c8a57047

View File

@ -237,7 +237,7 @@ check_avail:
selected -= count;
}
if ((host_addr & 0xff) == 0)
if ((host_addr & host_mask) == 0)
host_addr += 1;
done: