mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-06 20:10:11 +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)
|
return fmt.Errorf("parsing message: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
echoBody, ok := message.Body.(*icmp.Echo)
|
switch message.Body.(type) {
|
||||||
if !ok {
|
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)
|
return fmt.Errorf("%w: %T", ErrBodyUnsupported, message.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echoBody, _ := message.Body.(*icmp.Echo)
|
||||||
|
|
||||||
id := uint16(echoBody.ID) //nolint:gosec
|
id := uint16(echoBody.ID) //nolint:gosec
|
||||||
testIndex, testing := echoIDToTestIndex[id]
|
testIndex, testing := echoIDToTestIndex[id]
|
||||||
if !testing { // not an id we expected so ignore it
|
if !testing { // not an id we expected so ignore it
|
||||||
|
|||||||
Reference in New Issue
Block a user