Skip to content
Snippets Groups Projects
Commit a814731c authored by Pierre Lalet's avatar Pierre Lalet
Browse files

Merge pull request #66 from natisbad/master

Implementation of IPv6 ND attacks described in RFC 3756
parents 48ac7e53 af26c2a0
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -648,6 +648,16 @@ def in6_isincluded(addr, prefix, plen):
zero = inet_pton(socket.AF_INET6, prefix)
return zero == in6_and(temp, pref)
def in6_isllsnmaddr(str):
"""
Return True if provided address is a link-local solicited node
multicast address, i.e. belongs to ff02::1:ff00:0/104. False is
returned otherwise.
"""
temp = in6_and("\xff"*13+"\x00"*3, inet_pton(socket.AF_INET6, str))
temp2 = '\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x00\x00\x00'
return temp == temp2
def in6_isdocaddr(str):
"""
Returns True if provided address in printable format belongs to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment