Skip to content

Commit

Permalink
Address issue when parsing ICMPv6 packets with multi-part extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Barberio <insomniac@slackware.it>
  • Loading branch information
insomniacslk committed Apr 12, 2023
1 parent 600c6ea commit 2fb78ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/dublintraceroute/probes/probev6/udpv6probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ func (pr ProbeResponseUDPv6) Matches(pi probes.Probe) bool {
// this is not our packet
return false
}
if len(pr.payload) != len(p.Payload) {
if pr.InnerIPv6().PayloadLen != len(p.Payload)+inet.UDPHeaderLen {
// different payload length, not our packet
// NOTE: here I am using pr.InnerIPv6().PayloadLen instead of len(pr.payload)
// because the responding hop might use an RFC4884 multi-part ICMPv6 message,
// which has extra data at the end of time-exceeded and destination-unreachable
// messages
return false
}
return true
Expand Down

0 comments on commit 2fb78ea

Please sign in to comment.