nlmanager: ipnetwork: fix 'IPv4Address' object has no attribute 'split' exception
nlpacket: use IP[v4|6]Address object when network mask is not provided or needed
nlpacket: AttributeIPAddress: fix decode handler for Routes
During the python2 to 3 migration there was some refactoring
Seems like some code specific to Route-decoding was removed
This patch is fixing the issue by re-adding this code and
tweaking it a little bit (to make it nice and clean :))
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
As mentioned in a previous commit:
python3 ipaddress behave differently from python2-ipaddr, this is
a serious problem for us since it breaks most of the ip addresses
code.
>>> import ipaddress
>>> ipaddress.ip_network("10.10.10.242/10", False)
IPv4Network('10.0.0.0/10')
This is a problem for us, so we need to use a custom IPNetwork object.
Our custom IPNetwork object uses ipaddress.IPAddress under the hood
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>