]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Fri, 5 Jan 2001 23:44:56 +0000 (23:44 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 5 Jan 2001 23:44:56 +0000 (23:44 +0000)
 657.   [bug]           When a listen-on statement in an lwres block does not
                        specifiy a port, use 921, not 53.  Also update the
                        listen-on documentation. [RT #616]

CHANGES
doc/arm/Bv9ARM-book.xml
lib/dns/config/confparser.y.dirty

diff --git a/CHANGES b/CHANGES
index 09c9fb0f4f4b3273cdf0ea841ef6a7d8acff4bd0..5f877f4bdd644de37ce3abd95df5463ae729bd0d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,8 @@
 
+ 657.   [bug]           When a listen-on statement in an lwres block does not
+                        specifiy a port, use 921, not 53.  Also update the
+                        listen-on documentation. [RT #616]
+
  649.  [bug]           It was possible to join to an already running fctx
                        after it had "cloned" its events, but before it sent
                        them.  In this case, the event of the newly joined
index 134b67b2c2c4ce7bce3ffbd5bff216a994c3260d..3439244bd994c04628676cb579c8675ad2aaa176 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
                "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
 
-<!-- File: $Id: Bv9ARM-book.xml,v 1.72 2000/12/20 03:36:18 marka Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.72.2.1 2001/01/05 23:44:54 gson Exp $ -->
 
 <book>
 
@@ -2419,7 +2419,7 @@ lookups performed on behalf of clients by a caching name server.</para></entry>
       <para> This is the grammar of the <command>lwres</command>
       statement in the <filename>named.conf</filename> file:</para>
 <programlisting><command>lwres</command> {
-    <optional> listen-on { <replaceable>address_match_list</replaceable> }; </optional>
+    <optional> listen-on { <replaceable>ip_addr</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> ; <optional> <replaceable>ip_addr</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> ; ... </optional> }; </optional>
     <optional> view <replaceable>view_name</replaceable>; </optional>
     <optional> search { <replaceable>domain_name</replaceable> ; <optional> <replaceable>ip_addr</replaceable> ; ... </optional> }; </optional>
     <optional> ndots <replaceable>number</replaceable>; </optional>
index 13b4e8f7a2d89fcbffb1edeee5bca4e13a930ee5..1004d80ad7f5787e91a9344322a00f1b112a490d 100644 (file)
@@ -33,7 +33,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: confparser.y.dirty,v 1.44 2000/12/20 03:36:19 marka Exp $ */
+/* $Id: confparser.y.dirty,v 1.44.2.1 2001/01/05 23:44:56 gson Exp $ */
 
 #include <config.h>
 
@@ -113,9 +113,12 @@ static isc_lexspecials_t   specials;
 /*
  * XXXJAB The #define for the default OMAPI port is not available
  * to us, so we make our own.
+ *
+ * XXXBEW Same goes for the default LWRES port.
  */
 
 #define OMAPI_DEFAULT_PORT 953
+#define LWRES_DEFAULT_PORT 921
 
 #define CONF_MAX_IDENT 1024
 
@@ -157,6 +160,8 @@ static dns_peerlist_t       *currentpeerlist(dns_c_ctx_t *cfg,
                                         isc_boolean_t createIfNeeded);
 static isc_boolean_t   keydefinedinscope(dns_c_ctx_t *cfg,
                                          const char *name);
+static void            replace_zero_ports(dns_c_iplist_t *list,
+                                          in_port_t val);
 
 
 
@@ -1272,6 +1277,7 @@ option: /* Empty */
        }
        | L_ALSO_NOTIFY port_ip_list
        {
+               replace_zero_ports($2, default_port);
                tmpres = dns_c_ctx_setalsonotify(currcfg, $2);
                dns_c_iplist_detach(&$2);
 
@@ -2013,16 +2019,9 @@ port_ip_list: maybe_zero_port L_LBRACE ip_and_port_list L_RBRACE
        {
                in_port_t port = $1;
                dns_c_iplist_t *list = $3;
-               unsigned int i;
-
-               if (port == 0)
-                       port = default_port;
 
-               for (i = 0 ; i < list->nextidx ; i++) {
-                       if (isc_sockaddr_getport(&list->ips[i]) == 0) {
-                               isc_sockaddr_setport(&list->ips[i], port);
-                       }
-               }
+               if (port != 0)
+                       replace_zero_ports(list, port);
 
                $$ = list;
        };
@@ -4519,6 +4518,8 @@ view_option: L_FORWARD zone_forward_opt
        {
                dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
 
+               replace_zero_ports($2, default_port);
+
                INSIST(view != NULL);
 
                tmpres = dns_c_view_setalsonotify(view, $2);
@@ -5098,6 +5099,8 @@ zone_option: L_FILE L_QSTRING
 
                INSIST(zone != NULL);
 
+               replace_zero_ports($2, default_port);
+
                tmpres = dns_c_zone_setmasterips(zone, $2, ISC_FALSE);
                if (tmpres == ISC_R_EXISTS) {
                        parser_error(ISC_FALSE,
@@ -5708,6 +5711,8 @@ zone_option: L_FILE L_QSTRING
 
                INSIST(zone != NULL);
 
+               replace_zero_ports($2, default_port);
+
                tmpres = dns_c_zone_setalsonotify(zone, $2, ISC_FALSE);
                if (tmpres == ISC_R_EXISTS) {
                        parser_error(ISC_FALSE,
@@ -6018,6 +6023,9 @@ lwres_options_list: lwres_option L_EOS
 lwres_option: L_LISTEN_ON port_ip_list
        {
                dns_c_lwres_t *lwres;
+
+               replace_zero_ports($2, LWRES_DEFAULT_PORT);
+
                lwres = ISC_LIST_TAIL(currcfg->lwres->lwreslist);
                tmpres = dns_c_lwres_setlistenon(lwres, $2);
                dns_c_iplist_detach(&$2);
@@ -7106,3 +7114,13 @@ keydefinedinscope(dns_c_ctx_t *cfg, const char *name)
 
        return (rval);
 }
+
+static void
+replace_zero_ports(dns_c_iplist_t *list, in_port_t val) {
+       unsigned int i;
+
+       for (i = 0 ; i < list->nextidx ; i++) {
+               if (isc_sockaddr_getport(&list->ips[i]) == 0)
+                       isc_sockaddr_setport(&list->ips[i], val);
+       }
+}