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]
This commit is contained in:
Brian Wellington
2001-01-05 22:12:53 +00:00
parent bbd3d20d08
commit 54ce9b2e29
3 changed files with 34 additions and 12 deletions
+4
View File
@@ -1,3 +1,7 @@
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]
656. [func] Treat an unescaped newline in a quoted string as
an error. This means that TXT records with missing
close quotes should have meaningful errors printed.
+2 -2
View 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.77 2001/01/03 20:18:47 gson Exp $ -->
<!-- File: $Id: Bv9ARM-book.xml,v 1.78 2001/01/05 22:12:52 bwelling Exp $ -->
<book>
@@ -2461,7 +2461,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>
+28 -10
View 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.45 2001/01/05 22:12:50 bwelling 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);
}
}