Skip to content

Commit

Permalink
undo forced port 319 (#431)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #431

After 1fb59ca SPTP sends packets from port 319 and we no longer need this hack in ptp4u.

And with this change ptp4u is able to respond to `ptpings`!

Reviewed By: deathowl

Differential Revision: D61858305

fbshipit-source-id: a1038a4e85b134632a58822f2fb056203fe4f5a2
  • Loading branch information
abulimov authored and facebook-github-bot committed Dec 9, 2024
1 parent 6c87a6d commit ea3ac9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ptp/ptp4u/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,14 @@ func (s *Server) handleEventMessages(eventConn *net.UDPConn) {
if sc = worker.FindSubscription(dReq.Header.SourcePortIdentity, ptp.MessageDelayReq); sc == nil {
gclisa = timestamp.NewSockaddrWithPort(eclisa, ptp.PortGeneral)
// Create a new subscription
sc = NewSubscriptionClient(worker.queue, worker.signalingQueue, timestamp.NewSockaddrWithPort(eclisa, ptp.PortEvent), gclisa, ptp.MessageDelayReq, s.Config, subscriptionDuration, expire)
sc = NewSubscriptionClient(worker.queue, worker.signalingQueue, eclisa, gclisa, ptp.MessageDelayReq, s.Config, subscriptionDuration, expire)
worker.RegisterSubscription(dReq.Header.SourcePortIdentity, ptp.MessageDelayReq, sc)
go sc.Start(s.ctx)
} else {
// bump the subscription
sc.SetExpire(expire)
// sptp is stateless, port can change
sc.eclisa = eclisa
}
sc.UpdateSyncDelayReq(rxTS, dReq.SequenceID)
sc.UpdateAnnounceDelayReq(dReq.CorrectionField, dReq.SequenceID)
Expand Down

0 comments on commit ea3ac9e

Please sign in to comment.