mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 19:10:10 +00:00
Reject fe80:: as always not same
For our purposes, this same-subnet check doesn't apply to link-local
This commit is contained in:
parent
e6e89bcee5
commit
578b05604b
@ -66,6 +66,8 @@ def ip_on_same_subnet(first, second, prefix):
|
||||
second = second.replace('::ffff:', '')
|
||||
addrinf = socket.getaddrinfo(first, None, 0, socket.SOCK_STREAM)[0]
|
||||
fam = addrinf[0]
|
||||
if '%' in addrinf[-1][0]:
|
||||
return False
|
||||
ip = socket.inet_pton(fam, addrinf[-1][0])
|
||||
ip = int(codecs.encode(bytes(ip), 'hex'), 16)
|
||||
addrinf = socket.getaddrinfo(second, None, 0, socket.SOCK_STREAM)[0]
|
||||
|
Loading…
Reference in New Issue
Block a user