mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 19:40:12 +00:00
Remove IPv6 portion of IPv4 address
If it is presented as an IPv6 compatible IPv4 address, make it a normal IP address.
This commit is contained in:
parent
29b4045817
commit
a066f061c7
@ -59,6 +59,8 @@ def ip_on_same_subnet(first, second, prefix):
|
||||
|
||||
|
||||
def address_is_local(address):
|
||||
if '.' in address and address.startswith('::ffff:'):
|
||||
address = address.replace('::ffff:', '')
|
||||
for iface in netifaces.interfaces():
|
||||
for i4 in netifaces.ifaddresses(iface).get(2, []):
|
||||
cidr = mask_to_cidr(i4['netmask'])
|
||||
|
Loading…
Reference in New Issue
Block a user