Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion scapy/layers/inet6.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,20 @@ def answers(self, other):
elif other.nh == 43 and isinstance(other.payload, IPv6ExtHdrSegmentRouting): # noqa: E501
return self.payload.answers(other.payload.payload) # Buggy if self.payload is a IPv6ExtHdrRouting # noqa: E501
elif other.nh == 60 and isinstance(other.payload, IPv6ExtHdrDestOpt):
return self.payload.answers(other.payload.payload)
# Extension Headers can show weird behavious.
Copy link
Preview

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the comment: 'behavious' should be 'behavior'.

Suggested change
# Extension Headers can show weird behavious.
# Extension Headers can show weird behavior.

Copilot uses AI. Check for mistakes.

# Linux's sk_buff considers the IPv6 Payload
# to be either TCP, UDP or ICMP. It does not
# consider Extension Headers to be the payload.
# Following similar architecture, This small
Copy link
Preview

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word 'This' should not be capitalized mid-sentence. It should be 'this small'.

Suggested change
# Following similar architecture, This small
# Following similar architecture, this small

Copilot uses AI. Check for mistakes.

# modification let's packet flow with Destination
Copy link
Preview

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect use of apostrophe: 'let's' should be 'lets' (third person singular verb, not contraction).

Suggested change
# modification let's packet flow with Destination
# modification lets packet flow with Destination

Copilot uses AI. Check for mistakes.

# Option on both, request and response packets
# be captured as well.
if UDP in self and UDP in other:
return self[UDP].answers(other[UDP])
elif TCP in self and TCP in other:
return self[TCP].answers(other[TCP])
else:
return self.payload.answers(other.payload.payload) # Previous Implementation
elif self.nh == 60 and isinstance(self.payload, IPv6ExtHdrDestOpt): # BU in reply to BRR, for instance # noqa: E501
return self.payload.payload.answers(other.payload)
else:
Expand Down
Loading