Support Python2 ipaddr library.

Allows backward compatibility on platforms where the ipaddress library is not available.