initial changes towards removing ipaddress and using netaddr
This commit is contained in:
parent
93ce2a3755
commit
f431254e15
10 changed files with 47 additions and 67 deletions
|
@ -9,6 +9,8 @@ import socket
|
|||
import threading
|
||||
from socket import AF_INET, AF_INET6
|
||||
|
||||
import netaddr
|
||||
|
||||
from core import utils
|
||||
from core.constants import MOUNT_BIN, VNODED_BIN
|
||||
from core.emulator.data import LinkData, NodeData
|
||||
|
@ -1015,7 +1017,7 @@ class CoreNetworkBase(NodeBase):
|
|||
for address in netif.addrlist:
|
||||
ip, _sep, mask = address.partition("/")
|
||||
mask = int(mask)
|
||||
if ipaddress.is_ipv4_address(ip):
|
||||
if netaddr.valid_ipv4(ip):
|
||||
family = AF_INET
|
||||
ipl = socket.inet_pton(family, ip)
|
||||
interface2_ip4 = ipaddress.IpAddress(af=family, address=ipl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue