From 9983185d6d20d0b051c273eb9b4ae2fe8ad3d7b4 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 12 Jul 2017 18:12:32 +0200 Subject: [PATCH] ntp: define NTP port for configuration code --- conf.c | 4 ++-- ntp.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conf.c b/conf.c index f5583fa..c6d4bed 100644 --- a/conf.c +++ b/conf.c @@ -79,7 +79,7 @@ static void parse_tempcomp(char *); static int restarted = 0; static char *rtc_device; static int acquisition_port = -1; -static int ntp_port = 123; +static int ntp_port = NTP_PORT; static char *keys_file = NULL; static char *drift_file = NULL; static char *rtc_file = NULL; @@ -1179,7 +1179,7 @@ parse_broadcast(char *line) } } else { /* default port */ - port = 123; + port = NTP_PORT; } destination = (NTP_Broadcast_Destination *)ARR_GetNewElement(broadcasts); diff --git a/ntp.h b/ntp.h index e2abd84..801f264 100644 --- a/ntp.h +++ b/ntp.h @@ -38,6 +38,9 @@ typedef struct { typedef uint32_t NTP_int32; +/* The UDP port number used by NTP */ +#define NTP_PORT 123 + /* The NTP protocol version that we support */ #define NTP_VERSION 4