Suppress leap second in packets sent to clients when smoothing and leap
second slew mode are enabled.
if (SMT_IsEnabled() && (my_mode == MODE_SERVER || my_mode == MODE_BROADCAST)) {
smooth_time = 1;
smooth_offset = SMT_GetOffset(&local_transmit);
+
+ /* Suppress leap second when smoothing and slew mode are enabled */
+ if (REF_GetLeapMode() == REF_LeapModeSlew &&
+ (leap_status == LEAP_InsertSecond || leap_status == LEAP_DeleteSecond))
+ leap_status = LEAP_Normal;
} else {
smooth_time = 0;
smooth_offset = 0.0;
/* ================================================== */
+REF_LeapMode
+REF_GetLeapMode(void)
+{
+ return leap_mode;
+}
+
+/* ================================================== */
+
static double
Sqr(double x)
{
/* Set the handler for being notified of mode ending */
extern void REF_SetModeEndHandler(REF_ModeEndHandler handler);
+/* Get leap second handling mode */
+extern REF_LeapMode REF_GetLeapMode(void);
+
/* Function which takes a local cooked time and returns the estimated
time of the reference. It also returns the other parameters
required for forming the outgoing NTP packet.