Skip to content

Commit

Permalink
trace outgoing hard reset too
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Feb 9, 2024
1 parent 79c9cf0 commit b2fcbfd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/packetmuxer/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (s *Service) StartWorkers(
muxerToNetwork: *s.MuxerToNetwork,
networkToMuxer: s.NetworkToMuxer,
sessionManager: sessionManager,
tracer: config.Tracer(),
workersManager: workersManager,
}
workersManager.StartWorker(ws.moveUpWorker)
Expand Down Expand Up @@ -107,6 +108,9 @@ type workersState struct {
// sessionManager manages the OpenVPN session.
sessionManager *session.Manager

// tracer is a [model.HandshakeTracer].
tracer model.HandshakeTracer

// workersManager controls the workers lifecycle.
workersManager *workers.Manager
}
Expand Down Expand Up @@ -289,6 +293,12 @@ func (ws *workersState) serializeAndEmit(packet *model.Packet) error {
return err
}

ws.tracer.OnOutgoingPacket(
packet,
int(ws.sessionManager.NegotiationState()),
ws.hardResetCount,
)

// emit the packet. Possibly BLOCK writing to the networkio layer.
select {
case ws.muxerToNetwork <- rawPacket:
Expand Down

0 comments on commit b2fcbfd

Please sign in to comment.