Skip to content

Commit 42bb438

Browse files
committed
ICMPv6ND_NA: validate hlim==255 in answers() per RFC 4861
1 parent ce406ff commit 42bb438

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scapy/layers/inet6.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,10 @@ def hashret(self):
22582258
return bytes_encode(self.tgt) + self.payload.hashret()
22592259

22602260
def answers(self, other):
2261+
if not isinstance(self.underlayer, IPv6):
2262+
return False
2263+
if self.underlayer.hlim != 255:
2264+
return False
22612265
return isinstance(other, ICMPv6ND_NS) and self.tgt == other.tgt
22622266

22632267
# associated possible options : target link-layer option, Redirected header

0 commit comments

Comments
 (0)