Skip to content

Commit

Permalink
Fix leap placement issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewLester committed Jul 15, 2023
1 parent 7d57aea commit fea5f78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/ntpal/ntpal.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ type NTPalSystem struct {

address *net.UDPAddr
t ntp.TimestampEncoded /* update time */
leap byte /* leap indicator */
stratum byte /* stratum */
poll int8 /* poll interval */
precision int8 /* precision */
Expand Down Expand Up @@ -254,12 +253,15 @@ func NewSystem(host, port, config, drift, socket string) *NTPalSystem {
socket: socket,
drift: drift,
mode: ntp.SERVER,
leap: NOSYNC,
poll: MINPOLL,
precision: PRECISION,
stratum: MAXSTRAT,
hold: WATCH,
filtered: make(chan any),
FilteredProgress: make(chan any),
System: ntp.System{
Leap: NOSYNC,
},
}
// Map the local struct values to the embedded System's
system.System.Clock = &system.Clock.Clock
Expand Down Expand Up @@ -483,7 +485,7 @@ func (system *NTPalSystem) clockAdjust() {
"("+association.Srcaddr.IP.String()+"):",
sync,
"POLL:", strconv.Itoa(int(ntp.Log2ToDouble(association.Poll)))+"s",
"hPOLL:", strconv.Itoa(int(ntp.Log2ToDouble(association.Poll)))+"s",
"hPOLL:", strconv.Itoa(int(ntp.Log2ToDouble(association.Hpoll)))+"s",
"STRATUM:", association.Stratum,
"REFID:", refid,
"OFFSET:", association.Offset,
Expand Down

0 comments on commit fea5f78

Please sign in to comment.