Skip to content

Commit de00396

Browse files
committed
TUN-6778: Cleanup logs about ICMP
1 parent 013bdbd commit de00396

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ingress/icmp_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (ip *icmpProxy) Serve(ctx context.Context) error {
202202
// In unit test, we found out when the listener listens on 0.0.0.0, the socket reads the full packet after
203203
// the second reply
204204
if err := ip.handleFullPacket(icmpDecoder, buf[:n]); err != nil {
205-
ip.logger.Err(err).Str("dst", from.String()).Msg("Failed to parse ICMP reply as full packet")
205+
ip.logger.Debug().Err(err).Str("dst", from.String()).Msg("Failed to parse ICMP reply as full packet")
206206
}
207207
continue
208208
}

supervisor/supervisor.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"net"
78
"strings"
89
"time"
910

@@ -155,7 +156,11 @@ func (s *Supervisor) Run(
155156
if s.edgeTunnelServer.icmpRouter != nil {
156157
go func() {
157158
if err := s.edgeTunnelServer.icmpRouter.Serve(ctx); err != nil {
158-
s.log.Logger().Err(err).Msg("icmp router terminated")
159+
if errors.Is(err, net.ErrClosed) {
160+
s.log.Logger().Info().Err(err).Msg("icmp router terminated")
161+
} else {
162+
s.log.Logger().Err(err).Msg("icmp router terminated")
163+
}
159164
}
160165
}()
161166
}

0 commit comments

Comments
 (0)