]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Many files:
authorFrank Kardel <kardel@ntp.org>
Sat, 26 May 2007 15:10:28 +0000 (15:10 +0000)
committerFrank Kardel <kardel@ntp.org>
Sat, 26 May 2007 15:10:28 +0000 (15:10 +0000)
  Bug 841: make deferred binding to local interface the default

bk: 46584de49c0P5S-lUcLd1YSz5QDqkg

ChangeLog
html/confopt.html
html/ntpdc.html
include/ntp.h
include/ntp_request.h
ntpd/ntp_intres.c
ntpd/ntp_peer.c
ntpd/ntp_request.c
ntpdc/ntpdc_ops.c

index ae0a26518b4a9702612cc2e86b94e2608de5e6e8..2c4fd83cc7756620f599a4fbf6ec6e648a12363b 100644 (file)
--- 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.
index aeb522d101196bd53fe78b3ef27ffb079ab9efb2..e2a04c47cd6693567d966323b3279d1bba39fae1 100644 (file)
@@ -64,8 +64,6 @@
                        <dd>This option is used only with broadcast server and manycast client modes. It specifies the time-to-live <i><tt>ttl</tt></i> to use on broadcast server and multicast server and the maximum <i><tt>ttl</tt></i> 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.
                        <dt><tt>version <i>version</i></tt>
                        <dd>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 <tt>server,</tt> <tt>peer</tt> and <tt>broadcast</tt> commands.
-                       <dt><tt>dynamic</tt>
-                       <dd>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).
                </dl>
                <h4 id="aux">Auxilliary Commands</h4>
                <dl>
index 02bc13aec451325e9fd914c8a07f5f33426dd9fe..92fde1de78058bc1091d784d01c7e9b77352c558 100644 (file)
                <dt><tt>addpeer <i>peer_address</i> [
                <i>keyid</i> ] [ <i>version</i> ] [
                <tt>minpoll# | prefer | iburst  | burst | minpoll
-               <i>N</i> | <tt>maxpoll</tt> <i>N</i> [ <i>dynamic</i> ] [...] ]</tt>
+               <i>N</i> | <tt>maxpoll</tt> <i>N</i> [...] ]</tt>
                <dt><tt>addpeer <i>peer_address</i> [
                <tt>prefer | iburst | burst | minpoll
                <i>N</i> | <tt>maxpoll</tt> <i>N</i> | <tt>keyid</tt>
                        ntpd.  See the <a href="confopt.html">Server Options</a> page for further information.
                        Each flag (or its absence) replaces the
                        previous setting. The <tt>prefer</tt> 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 <tt>dynamic</tt> 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.
                        <dt><tt>addserver <i>peer_address</i> [
                <i>keyid</i> ] [ <i>version</i> ] [
                <tt>minpoll# | prefer | iburst  | burst | minpoll
                <dt><tt>addserver <i>peer_address</i> [
                <tt>prefer | iburst | burst | minpoll
                <i>N</i> | <tt>maxpoll</tt> <i>N</i> | <tt>keyid</tt>
-                       <i>N</i> | <tt>version</tt> <i>N</i> [...] [ <i>dynamic</i> ] ]</tt>
+                       <i>N</i> | <tt>version</tt> <i>N</i> [...] ]</tt>
                        <dd>Identical to the addpeer command, except that the operating mode is client.
                        <dt><tt>broadcast <i>peer_address</i> [
                        <i>keyid</i> ] [ <i>version</i> ] [ <i>prefer</i> ]</tt>
index ce40df6ecc6382fc4239548ea2ca097270151611..83006365328057c8a59a28afe289b853ffce7dbf 100644 (file)
@@ -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
index a0cf8057277c53c8396e6df1baa364e359c572a1..eb13fadb8fecb87f99c8410ae3823d468bd41933 100644 (file)
@@ -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
index 9e851cb5c61c1ce56b60f4254c3e7f077f2dcbc0..782df82b044c2eb7d2423e531f20869c59c01848 100644 (file)
@@ -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.
index 69c5e3e1431ecec0e5543a972382b8c96b3ef238..c7ded70ccef676461a756557726253800c5502f9 100644 (file)
@@ -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)
index 38dfccbbce5a9ad46e363db0c3592191d5b010de..d9a486c6294480888ecc5730bb2591d186d0afc6 100644 (file)
@@ -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;
index 2d6342307d8a853067a788a8e4fc6145891be08d..cdd2163a42b7562a762f6433cd265693dcb802a8 100644 (file)
@@ -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"))