mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-07 04:20:12 +02:00
hotfix(pmtud/icmp): ignore non echo messages instead of returning an error
This commit is contained in:
@@ -151,11 +151,17 @@ func collectReplies(conn net.PacketConn, ipVersion string,
|
||||
return fmt.Errorf("parsing message: %w", err)
|
||||
}
|
||||
|
||||
echoBody, ok := message.Body.(*icmp.Echo)
|
||||
if !ok {
|
||||
switch message.Body.(type) {
|
||||
case *icmp.Echo:
|
||||
case *icmp.DstUnreach, *icmp.TimeExceeded:
|
||||
logger.Debugf("ignoring ICMP message (type: %d, code: %d)", message.Type, message.Code)
|
||||
continue
|
||||
default:
|
||||
return fmt.Errorf("%w: %T", ErrBodyUnsupported, message.Body)
|
||||
}
|
||||
|
||||
echoBody, _ := message.Body.(*icmp.Echo)
|
||||
|
||||
id := uint16(echoBody.ID) //nolint:gosec
|
||||
testIndex, testing := echoIDToTestIndex[id]
|
||||
if !testing { // not an id we expected so ignore it
|
||||
|
||||
Reference in New Issue
Block a user