firefart/network_info

inetnum to CIDR conversion discards networks

hex2a opened this issue · 1 comments

hex2a commented

inetnum objects may contain addresses that can not be converted to a single CIDR block.

iprange_to_cidrs returns multiple blocks in that case, only the first one is used:
https://github.com/FireFart/network_info/blob/7dd859cfd4ca6a5d270c515c36a8471f76198807/create_db.py#L69-L70

I can prepare a PR to replace the CIDR column in the model with a start/end address

The CIDR column is a special type in postgres to select single IPs. I think we need to process each returned element as a single CIDR block here