Network scan, last available IP address not detected

**CMK version:**2.1.0p28 raw and enterprise
**OS version:**RedHat 7.9

I’m using Network Scan applied on one folder with “IP Network” definition (Network address and netmask).
It appears that the last available address is never detected by the network scan.
For exemple :
with network xxx.xxx.xxx.0/24, the IP address xxx.xxx.xxx.254 is not detected
with network xxx.xxx.xxx.0/26, the IP address xxx.xxx.xxx.62 is not detected

With “IP range” definition (From : To:), these IP addresses are detected.

Any suggestions?

I think there is a problem with network_scan.py (in gui/watolib/) in the function _ip_addresses_of_network. The last IP address is deleted twice.

net_addr, net_bits = spec
ip_int = _ip_int_from_string(net_addr)
mask_int = _mask_bits_to_int(int(net_bits))
first = ip_int & (_FULL_IPV4 ^ mask_int)
last = ip_int | (1 << (32 - int(net_bits))) - 1
return [_string_from_ip_int(i) for i in range(first + 1, last - 1)]

I changed
last = ip_int | (1 << (32 - int(net_bits))) - 1
by
last = ip_int | (1 << (32 - int(net_bits)))
and problem is solved.