From f36af8e0c350328bb3257bf2082c22b3d8fde2ec Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Wed, 8 Jan 2014 18:52:36 +0100 Subject: [PATCH] uds: disable the accidentally enabled announce timer. Commit e425da2f inadvertently enabled the announce timer on the UDS port, causing it to continually reopen the socket when in slave mode. This patch fixes the issue by passing zero in the 'span' field of the new function, set_tmo_random, which disables the timer again. Signed-off-by: Richard Cochran Reported-by: Rohrer Hansjoerg --- ds.h | 1 + port.c | 3 ++- ptp4l.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ds.h b/ds.h index 0cc94b5..2ecda8d 100644 --- a/ds.h +++ b/ds.h @@ -130,6 +130,7 @@ struct port_defaults { UInteger8 announceReceiptTimeout; UInteger8 syncReceiptTimeout; UInteger8 transportSpecific; + int announce_span; int path_trace_enabled; int follow_up_info; int freq_est_interval; /*log seconds*/ diff --git a/port.c b/port.c index b382194..7229429 100644 --- a/port.c +++ b/port.c @@ -843,7 +843,8 @@ static void port_nrate_initialize(struct port *p) static int port_set_announce_tmo(struct port *p) { return set_tmo_random(p->fda.fd[FD_ANNOUNCE_TIMER], - p->announceReceiptTimeout, 1, p->logAnnounceInterval); + p->announceReceiptTimeout, + p->pod.announce_span, p->logAnnounceInterval); } static int port_set_delay_tmo(struct port *p) diff --git a/ptp4l.c b/ptp4l.c index d5482ce..d5a3aab 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -84,6 +84,7 @@ static struct config cfg_settings = { .announceReceiptTimeout = 3, .syncReceiptTimeout = 0, .transportSpecific = 0, + .announce_span = 1, .path_trace_enabled = 0, .follow_up_info = 0, .freq_est_interval = 1,