From: Frank Kardel Date: Sat, 26 May 2007 15:10:28 +0000 (+0000) Subject: Many files: X-Git-Tag: NTP_4_2_5P38~2^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e4ea203932885e85c74b9713b9df13b1995d3ec;p=thirdparty%2Fntp.git Many files: Bug 841: make deferred binding to local interface the default bk: 46584de49c0P5S-lUcLd1YSz5QDqkg --- diff --git a/ChangeLog b/ChangeLog index ae0a26518..2c4fd83cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* [Bug 841] make deferred binding to local interface the default + (allows peers/servers to be configured even when no route exists) * [Bug 840] do fudge configuration AFTER peers (thus refclocks) have been configured * [Bug 832] Add libisc/log.c headers to the distribution. * [Bug 808] Only write the drift file if we are in state 4. diff --git a/html/confopt.html b/html/confopt.html index aeb522d10..e2a04c47c 100644 --- a/html/confopt.html +++ b/html/confopt.html @@ -64,8 +64,6 @@
This option is used only with broadcast server and manycast client modes. It specifies the time-to-live ttl to use on broadcast server and multicast server and the maximum ttl for the expanding ring search with manycast client packets. Selection of the proper value, which defaults to 127, is something of a black art and should be coordinated with the network administrator.
version version
Specifies the version number to be used for outgoing NTP packets. Versions 1-4 are the choices, with version 4 the default. This option is valid only with the server, peer and broadcast commands. -
dynamic -
Allows a server/peer to be configured even if it is not reachable at configuration time. It is assumed that at some point in the future the network environment changes so that this server/peer can be reached. This option is useful to configure servers/peers on mobile systems with intermittent network access (e.g. wlan clients).

Auxilliary Commands

diff --git a/html/ntpdc.html b/html/ntpdc.html index 02bc13aec..92fde1de7 100644 --- a/html/ntpdc.html +++ b/html/ntpdc.html @@ -134,7 +134,7 @@
addpeer peer_address [ keyid ] [ version ] [ minpoll# | prefer | iburst | burst | minpoll - N | maxpoll N [ dynamic ] [...] ] + N | maxpoll N [...] ]
addpeer peer_address [ prefer | iburst | burst | minpoll N | maxpoll N | keyid @@ -163,7 +163,6 @@ ntpd. See the Server Options page for further information. Each flag (or its absence) replaces the previous setting. The prefer keyword indicates a preferred peer (and thus will be used primarily for clock synchronisation if possible). The preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronisation so is the PPS signal. - The dynamic keyword allows association configuration even when no suitable network interface is found at configuration time. The dynamic interface update mechanism may complete the configuration when new interfaces appear (e.g. WLAN/PPP interfaces) at a later time and thus render the association operable.
addserver peer_address [ keyid ] [ version ] [ minpoll# | prefer | iburst | burst | minpoll @@ -171,7 +170,7 @@
addserver peer_address [ prefer | iburst | burst | minpoll N | maxpoll N | keyid - N | version N [...] [ dynamic ] ] + N | version N [...] ]
Identical to the addpeer command, except that the operating mode is client.
broadcast peer_address [ keyid ] [ version ] [ prefer ] diff --git a/include/ntp.h b/include/ntp.h index ce40df6ec..830063653 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -433,7 +433,6 @@ struct peer { #define FLAG_FIXPOLL 0x1000 /* stick at minpoll */ #define FLAG_TRUE 0x2000 /* select truechimer */ #define FLAG_PREEMPT 0x4000 /* preemptable association */ -#define FLAG_DYNAMIC 0x8000 /* dynamic addresses - allow configuration even if no interface is found */ /* * Definitions for the clear() routine. We use memset() to clear diff --git a/include/ntp_request.h b/include/ntp_request.h index a0cf80572..eb13fadb8 100644 --- a/include/ntp_request.h +++ b/include/ntp_request.h @@ -600,7 +600,6 @@ struct conf_peer { #define CONF_FLAG_IBURST 0x08 #define CONF_FLAG_NOSELECT 0x10 #define CONF_FLAG_SKEY 0x20 -#define CONF_FLAG_DYNAMIC 0x40 /* * Structure for passing peer deletion information. Currently diff --git a/ntpd/ntp_intres.c b/ntpd/ntp_intres.c index 9e851cb5c..782df82b0 100644 --- a/ntpd/ntp_intres.c +++ b/ntpd/ntp_intres.c @@ -1059,7 +1059,7 @@ readconf( } if ((intval[TOK_FLAGS] & ~(FLAG_AUTHENABLE | FLAG_PREFER | - FLAG_NOSELECT | FLAG_BURST | FLAG_IBURST | FLAG_SKEY | FLAG_DYNAMIC)) + FLAG_NOSELECT | FLAG_BURST | FLAG_IBURST | FLAG_SKEY)) != 0) { msyslog(LOG_ERR, "invalid flags (%ld) in file %s", intval[TOK_FLAGS], name); @@ -1079,8 +1079,6 @@ readconf( flags |= CONF_FLAG_IBURST; if (intval[TOK_FLAGS] & FLAG_SKEY) flags |= CONF_FLAG_SKEY; - if (intval[TOK_FLAGS] & FLAG_DYNAMIC) - flags |= CONF_FLAG_DYNAMIC; /* * This is as good as we can check it. Add it in. diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index 69c5e3e14..c7ded70cc 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -760,24 +760,7 @@ newpeer( ISC_LINK_INIT(peer, ilink); /* set up interface link chain */ - dstadr = select_peerinterface(peer, srcadr, dstadr, cast_flags); - - /* - * If we can't find an interface to use we return a NULL - * unless the DYNAMIC flag is set - then we expect the dynamic - * interface detection code to bind us some day to an interface - */ - if (dstadr == NULL && !(flags & FLAG_DYNAMIC)) - { - msyslog(LOG_ERR, "Cannot find existing interface for address %s", stoa(srcadr)); - - peer->next = peer_free; - peer_free = peer; - peer_associations--; - peer_free_count++; - - return (NULL); - } + set_peerdstadr(peer, select_peerinterface(peer, srcadr, dstadr, cast_flags)); peer->srcadr = *srcadr; peer->hmode = (u_char)hmode; @@ -786,8 +769,6 @@ newpeer( peer->maxpoll = (u_char)min(NTP_MAXPOLL, maxpoll); peer->flags = flags; - set_peerdstadr(peer, dstadr); - #ifdef DEBUG if (debug > 2) { if (peer->dstadr) diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index 38dfccbbc..d9a486c62 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -1345,7 +1345,7 @@ do_conf( && temp_cp.hmode != MODE_BROADCAST) fl = 1; if (temp_cp.flags & ~(CONF_FLAG_AUTHENABLE | CONF_FLAG_PREFER - | CONF_FLAG_BURST | CONF_FLAG_IBURST | CONF_FLAG_SKEY | CONF_FLAG_DYNAMIC)) + | CONF_FLAG_BURST | CONF_FLAG_IBURST | CONF_FLAG_SKEY)) fl = 1; cp = (struct conf_peer *) ((char *)cp + INFO_ITEMSIZE(inpkt->mbz_itemsize)); @@ -1378,8 +1378,6 @@ do_conf( fl |= FLAG_IBURST; if (temp_cp.flags & CONF_FLAG_SKEY) fl |= FLAG_SKEY; - if (temp_cp.flags & CONF_FLAG_DYNAMIC) - fl |= FLAG_DYNAMIC; if (client_v6_capable && temp_cp.v6_flag != 0) { peeraddr.ss_family = AF_INET6; diff --git a/ntpdc/ntpdc_ops.c b/ntpdc/ntpdc_ops.c index 2d6342307..cdd2163a4 100644 --- a/ntpdc/ntpdc_ops.c +++ b/ntpdc/ntpdc_ops.c @@ -119,10 +119,10 @@ struct xcmd opcmds[] = { { "", "", "", "" }, "display event timer subsystem statistics" }, { "addpeer", addpeer, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, - { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|dynamic|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." }, + { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." }, "configure a new peer association" }, { "addserver", addserver, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, - { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|dynamic|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." }, + { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." }, "configure a new server" }, { "addrefclock",addrefclock, { NTP_ADD, OPT|NTP_UINT, OPT|NTP_STR, OPT|NTP_STR }, { "addr", "mode", "minpoll|prefer", "minpoll|prefer" }, @@ -1332,8 +1332,6 @@ again: flags |= CONF_FLAG_PREFER; else if (STREQ(pcmd->argval[items].string, "burst")) flags |= CONF_FLAG_BURST; - else if (STREQ(pcmd->argval[items].string, "dynamic")) - flags |= CONF_FLAG_DYNAMIC; else if (STREQ(pcmd->argval[items].string, "iburst")) flags |= CONF_FLAG_IBURST; else if (!refc && STREQ(pcmd->argval[items].string, "keyid"))