(5) [S] Server does not seem to impose the 64K limit on the number of addresses specified using ranges.
Andris Zeila yes, I understand that it should be done by frontend. But server does limit the bitmask to 16+ (112+) and I'm now wondering if it's right.
Andris Zeila Iprange parsing functions should not check the range for any limits. However a new function to check the range size should be added and used in discoverer to validate the range before trying to iterate through it.
Andris Zeila RESOLVED in r50653
Aleksandrs Saveljevs A new constant was introduced:
#define ZBX_DISCOVERER_IPRANGE_LIMIT (64 * ZBX_KIBIBYTE)
It is then used like so:
zabbix_log(LOG_LEVEL_WARNING, "discovery rule \"%s\": IP range exceeds %d KB address limit",
drule->name, ZBX_DISCOVERER_IPRANGE_LIMIT / ZBX_KIBIBYTE);
However, IP ranges are not exactly measured in kibibytes.
There is also a suggestion to rename iprange_get_address_count() to iprange_volume().
Finally, iprange_volume() can overflow a 64-bit integer. Its return value should probably be limited by ZBX_MAX_UINT64 (a new constant).
Whie at it, please review r50664. REOPENED.
Andris Zeila RESOLVED in r50668
Aleksandrs Saveljevs r50672 removes bytes completely from ZBX_DISCOVERER_IPRANGE_LIMIT. RESOLVED.
Andris Zeila CLOSED