Skip to content

Commit

Permalink
Merge pull request #408 from AkihiroSuda/fix-392
Browse files Browse the repository at this point in the history
Move several log messages to the debug level
  • Loading branch information
openshift-merge-bot[bot] authored Oct 17, 2024
2 parents b5809e3 + 2b42672 commit 0d35eaa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pkg/services/forwarder/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ func TCP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mute
ep, tcpErr := r.CreateEndpoint(&wq)
r.Complete(false)
if tcpErr != nil {
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
if _, ok := tcpErr.(*tcpip.ErrConnectionRefused); ok {
// transient error
log.Debugf("r.CreateEndpoint() = %v", tcpErr)
} else {
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
}
return
}

Expand Down
7 changes: 6 additions & 1 deletion pkg/services/forwarder/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ func UDP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mute
var wq waiter.Queue
ep, tcpErr := r.CreateEndpoint(&wq)
if tcpErr != nil {
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
if _, ok := tcpErr.(*tcpip.ErrConnectionRefused); ok {
// transient error
log.Debugf("r.CreateEndpoint() = %v", tcpErr)
} else {
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
}
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/tap/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (e *Switch) DeliverNetworkPacket(_ tcpip.NetworkProtocolNumber, pkt *stack.

func (e *Switch) Accept(ctx context.Context, rawConn net.Conn, protocol types.Protocol) error {
conn := protocolConn{Conn: rawConn, protocolImpl: protocolImplementation(protocol)}
log.Infof("new connection from %s to %s", conn.RemoteAddr().String(), conn.LocalAddr().String())
log.Debugf("new connection from %s to %s", conn.RemoteAddr().String(), conn.LocalAddr().String())
id, failed := e.connect(conn)
if failed {
log.Error("connection failed")
Expand Down

0 comments on commit 0d35eaa

Please sign in to comment.