fix logging of sent Version Negotiation Packets (#3691)

This commit is contained in:
Marten Seemann
2023-02-13 23:51:38 +13:00
committed by GitHub
parent 59be5ae299
commit ac36330dc8

View File

@@ -341,7 +341,7 @@ func (s *baseServer) handlePacketImpl(p *receivedPacket) bool /* is the buffer s
return false return false
} }
if !s.config.DisableVersionNegotiationPackets { if !s.config.DisableVersionNegotiationPackets {
go s.sendVersionNegotiationPacket(p.remoteAddr, src, dest, p.info.OOB()) go s.sendVersionNegotiationPacket(p.remoteAddr, src, dest, p.info.OOB(), v)
} }
return false return false
} }
@@ -669,8 +669,8 @@ func (s *baseServer) sendError(remoteAddr net.Addr, hdr *wire.Header, sealer han
return err return err
} }
func (s *baseServer) sendVersionNegotiationPacket(remote net.Addr, src, dest protocol.ArbitraryLenConnectionID, oob []byte) { func (s *baseServer) sendVersionNegotiationPacket(remote net.Addr, src, dest protocol.ArbitraryLenConnectionID, oob []byte, v protocol.VersionNumber) {
s.logger.Debugf("Client offered version %s, sending Version Negotiation") s.logger.Debugf("Client offered version %s, sending Version Negotiation", v)
data := wire.ComposeVersionNegotiation(dest, src, s.config.Versions) data := wire.ComposeVersionNegotiation(dest, src, s.config.Versions)
if s.config.Tracer != nil { if s.config.Tracer != nil {