mirror of https://github.com/secdev/scapy.git
Issue #892: in6_isanycast inconsistent
This commit is contained in:
parent
67db066a99
commit
9d4a1202b7
|
@ -535,9 +535,10 @@ def in6_iseui64(x):
|
||||||
def in6_isanycast(x): # RFC 2526
|
def in6_isanycast(x): # RFC 2526
|
||||||
if in6_iseui64(x):
|
if in6_iseui64(x):
|
||||||
s = '::fdff:ffff:ffff:ff80'
|
s = '::fdff:ffff:ffff:ff80'
|
||||||
x = in6_and(x, inet_pton(socket.AF_INET6, '::ffff:ffff:ffff:ff80'))
|
packed_x = inet_pton(socket.AF_INET6, x)
|
||||||
x = in6_and(x, inet_pton(socket.AF_INET6, s))
|
packed_s = inet_pton(socket.AF_INET6, s)
|
||||||
return x == inet_pton(socket.AF_INET6, s)
|
x_and_s = in6_and(packed_x, packed_s)
|
||||||
|
return x_and_s == packed_s
|
||||||
else:
|
else:
|
||||||
# not EUI-64
|
# not EUI-64
|
||||||
#| n bits | 121-n bits | 7 bits |
|
#| n bits | 121-n bits | 7 bits |
|
||||||
|
|
Loading…
Reference in New Issue