diff --git a/config.c b/config.c index 4c5182e..d8ce1e2 100644 --- a/config.c +++ b/config.c @@ -104,6 +104,7 @@ struct config_item config_tab[] = { PORT_ITEM_INT("logSyncInterval", 0, INT8_MIN, INT8_MAX), GLOB_ITEM_INT("logging_level", LOG_INFO, PRINT_LEVEL_MIN, PRINT_LEVEL_MAX), GLOB_ITEM_INT("max_frequency", 900000000, 0, INT_MAX), + PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, INT_MAX), GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX), PORT_ITEM_INT("path_trace_enabled", 0, 0, 1), GLOB_ITEM_DBL("pi_integral_const", 0.0, 0.0, DBL_MAX), @@ -269,17 +270,9 @@ static enum parser_result parse_pod_setting(const char *option, struct port_defaults *pod) { int val; - unsigned int uval; - enum parser_result r; - if (!strcmp(option, "neighborPropDelayThresh")) { - r = get_ranged_uint(value, &uval, 0, UINT32_MAX); - if (r != PARSED_OK) - return r; - pod->neighborPropDelayThresh = uval; - - } else if (!strcmp(option, "min_neighbor_prop_delay")) { + if (!strcmp(option, "min_neighbor_prop_delay")) { r = get_ranged_int(value, &val, INT_MIN, -1); if (r != PARSED_OK) return r; diff --git a/ds.h b/ds.h index 9ab07e3..fb91d00 100644 --- a/ds.h +++ b/ds.h @@ -125,7 +125,6 @@ struct portDS { struct port_defaults { struct fault_interval flt_interval_pertype[FT_CNT]; - UInteger32 neighborPropDelayThresh; /*nanoseconds*/ int min_neighbor_prop_delay; /*nanoseconds*/ int tx_timestamp_offset; /*nanoseconds*/ int rx_timestamp_offset; /*nanoseconds*/ diff --git a/port.c b/port.c index 96422bb..1e01a78 100644 --- a/port.c +++ b/port.c @@ -1457,7 +1457,7 @@ static int port_initialize(struct port *p) p->transportSpecific <<= 4; p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval"); p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval"); - p->neighborPropDelayThresh = p->pod.neighborPropDelayThresh; + p->neighborPropDelayThresh = config_get_int(cfg, p->name, "neighborPropDelayThresh"); p->min_neighbor_prop_delay = p->pod.min_neighbor_prop_delay; for (i = 0; i < N_TIMER_FDS; i++) { diff --git a/ptp4l.c b/ptp4l.c index 0eff87d..713bd4e 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -79,9 +79,6 @@ static struct config cfg_settings = { }, .pod = { - /* Default to very a large neighborPropDelay threshold */ - .neighborPropDelayThresh = 20000000, - .min_neighbor_prop_delay = -20000000, .tx_timestamp_offset = 0, .rx_timestamp_offset = 0, },