Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
dfd7798d
Commit
dfd7798d
authored
Nov 25, 2000
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
578. [func] Notify-source, specify the source address for notify
messages.
parent
3b1a5821
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
739 additions
and
22 deletions
+739
-22
CHANGES
CHANGES
+3
-0
bin/named/zoneconf.c
bin/named/zoneconf.c
+42
-1
bin/tests/system/notify/ns1/named.conf
bin/tests/system/notify/ns1/named.conf
+2
-1
bin/tests/system/notify/ns2/named.conf
bin/tests/system/notify/ns2/named.conf
+2
-1
bin/tests/system/notify/ns3/named.conf
bin/tests/system/notify/ns3/named.conf
+2
-1
doc/arm/Bv9ARM-book.xml
doc/arm/Bv9ARM-book.xml
+40
-1
lib/dns/config/confctx.c
lib/dns/config/confctx.c
+10
-1
lib/dns/config/confparser.y.dirty
lib/dns/config/confparser.y.dirty
+205
-2
lib/dns/config/confview.c
lib/dns/config/confview.c
+10
-1
lib/dns/config/confzone.c
lib/dns/config/confzone.c
+277
-1
lib/dns/include/dns/confctx.h
lib/dns/include/dns/confctx.h
+22
-6
lib/dns/include/dns/confview.h
lib/dns/include/dns/confview.h
+19
-1
lib/dns/include/dns/confzone.h
lib/dns/include/dns/confzone.h
+17
-1
lib/dns/include/dns/zone.h
lib/dns/include/dns/zone.h
+47
-1
lib/dns/zone.c
lib/dns/zone.c
+41
-3
No files found.
CHANGES
View file @
dfd7798d
578. [func] Notify-source, specify the source address for notify
messages.
577. [func] Log illegal RDATA combinations. e.g. multiple
singlton types, cname and other data.
...
...
bin/named/zoneconf.c
View file @
dfd7798d
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zoneconf.c,v 1.7
1
2000/11/
18
02:
54:22 gson
Exp $ */
/* $Id: zoneconf.c,v 1.7
2
2000/11/
25
02:
43:39 marka
Exp $ */
#include <config.h>
...
...
@@ -316,6 +316,47 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
}
else
RETERR
(
dns_zone_setalsonotify
(
zone
,
NULL
,
0
));
/* All zone options, then all view, then all options. */
result
=
dns_c_zone_getnotifysource
(
czone
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_zone_gettransfersource
(
czone
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
&&
cview
!=
NULL
)
result
=
dns_c_view_getnotifysource
(
cview
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
&&
cview
!=
NULL
)
result
=
dns_c_view_gettransfersource
(
cview
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
&&
cview
!=
NULL
)
result
=
dns_c_view_getquerysource
(
cview
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_ctx_getnotifysource
(
cctx
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_ctx_gettransfersource
(
cctx
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_ctx_getquerysource
(
cctx
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
sockaddr
=
sockaddr_any4
;
dns_zone_setnotifysrc4
(
zone
,
&
sockaddr
);
result
=
dns_c_zone_getnotifysourcev6
(
czone
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_zone_gettransfersourcev6
(
czone
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
&&
cview
!=
NULL
)
result
=
dns_c_view_getnotifysourcev6
(
cview
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
&&
cview
!=
NULL
)
result
=
dns_c_view_gettransfersourcev6
(
cview
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
&&
cview
!=
NULL
)
result
=
dns_c_view_getquerysourcev6
(
cview
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_ctx_getnotifysourcev6
(
cctx
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_ctx_gettransfersourcev6
(
cctx
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
result
=
dns_c_ctx_getquerysourcev6
(
cctx
,
&
sockaddr
);
if
(
result
!=
ISC_R_SUCCESS
)
sockaddr
=
sockaddr_any6
;
dns_zone_setnotifysrc6
(
zone
,
&
sockaddr
);
RETERR
(
configure_zone_acl
(
czone
,
cctx
,
cview
,
ac
,
zone
,
dns_c_zone_getallowtransfer
,
dns_c_view_gettransferacl
,
...
...
bin/tests/system/notify/ns1/named.conf
View file @
dfd7798d
...
...
@@ -15,10 +15,11 @@
*
WITH
THE
USE
OR
PERFORMANCE
OF
THIS
SOFTWARE
.
*/
/* $
Id
:
named
.
conf
,
v
1
.
1
2
2000
/
11
/
2
1
23
:
49
:
39
gson
Exp
$ */
/* $
Id
:
named
.
conf
,
v
1
.
1
3
2000
/
11
/
2
5
02
:
43
:
40
marka
Exp
$ */
options
{
query
-
source
address
10
.
53
.
0
.
1
;
notify
-
source
10
.
53
.
0
.
1
;
transfer
-
source
10
.
53
.
0
.
1
;
port
5300
;
pid
-
file
"named.pid"
;
...
...
bin/tests/system/notify/ns2/named.conf
View file @
dfd7798d
...
...
@@ -15,10 +15,11 @@
*
WITH
THE
USE
OR
PERFORMANCE
OF
THIS
SOFTWARE
.
*/
/* $
Id
:
named
.
conf
,
v
1
.
1
3
2000
/
11
/
2
1
23
:
4
9
:
41
gson
Exp
$ */
/* $
Id
:
named
.
conf
,
v
1
.
1
4
2000
/
11
/
2
5
02
:
4
3
:
41
marka
Exp
$ */
options
{
query
-
source
address
10
.
53
.
0
.
2
;
notify
-
source
10
.
53
.
0
.
2
;
transfer
-
source
10
.
53
.
0
.
2
;
port
5300
;
pid
-
file
"named.pid"
;
...
...
bin/tests/system/notify/ns3/named.conf
View file @
dfd7798d
...
...
@@ -15,10 +15,11 @@
*
WITH
THE
USE
OR
PERFORMANCE
OF
THIS
SOFTWARE
.
*/
/* $
Id
:
named
.
conf
,
v
1
.
1
5
2000
/
11
/
2
1
23
:
4
9
:
4
3
gson
Exp
$ */
/* $
Id
:
named
.
conf
,
v
1
.
1
6
2000
/
11
/
2
5
02
:
4
3
:
4
2
marka
Exp
$ */
options
{
query
-
source
address
10
.
53
.
0
.
3
;
notify
-
source
10
.
53
.
0
.
3
;
transfer
-
source
10
.
53
.
0
.
3
;
port
5300
;
pid
-
file
"named.pid"
;
...
...
doc/arm/Bv9ARM-book.xml
View file @
dfd7798d
...
...
@@ -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.4
8
2000/11/25 0
0:26:17 mws
Exp $ -->
<!-- File: $Id: Bv9ARM-book.xml,v 1.4
9
2000/11/25 0
2:43:44 marka
Exp $ -->
<book>
...
...
@@ -2479,6 +2479,8 @@ lookups performed on behalf of clients by a caching name server.</para></entry>
<optional>
transfers-per-ns
<replaceable>
number
</replaceable>
;
</optional>
<optional>
transfer-source
<replaceable>
ip4_addr
</replaceable>
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
transfer-source-v6
<replaceable>
ip6_addr
</replaceable>
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
notify-source
<replaceable>
ip4_addr
</replaceable>
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
notify-source-v6
<replaceable>
ip6_addr
</replaceable>
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
also-notify {
<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>
max-ixfr-log-size
<replaceable>
number
</replaceable>
;
</optional>
<optional>
coresize
<replaceable>
size_spec
</replaceable>
;
</optional>
...
...
@@ -3092,6 +3094,25 @@ in the configuration file.</para></entry>
<entry
colname =
"2"
><para>
The same as
<command>
transfer-source
</command>
,
except zone transfers are performed using IPv6.
</para></entry>
</row>
<row
rowsep =
"0"
>
<entry
colname =
"1"
><para><command>
notify-source
</command></para></entry>
<entry
colname =
"2"
><para><command>
notify-source
</command>
determines
which local address and optionally UDP port, will be used to send NOTIFY
messages. If a
<command>
notify-source
</command>
is not specified then
then the
<command>
transfer-source
</command>
will be used and if that
is not specified the
<command>
query-source
</command>
will be use.
This address must appear in the remote end's
<command>
masters
</command>
zone clause.
This statement sets the
<command>
notify-source
</command>
for all zones,
but can be overridden on a per-zone / per-view basis by including a
<command>
notify-source
</command>
statement within the
<command>
zone
</command>
/
<command>
view
</command>
blocks in the configuration file.
</para></entry>
</row>
<row
rowsep =
"0"
>
<entry
colname =
"1"
><para><command>
notify-source-v6
</command></para></entry>
<entry
colname =
"2"
><para>
The same as
<command>
notify-source
</command>
,
except notify messages are sent using IPv6.
</para></entry>
</row>
</tbody>
</tgroup>
</informaltable>
...
...
@@ -3606,6 +3627,8 @@ Statement Grammar</title>
<optional>
pubkey
<replaceable>
number
</replaceable>
<replaceable>
number
</replaceable>
<replaceable>
number
</replaceable>
<replaceable>
string
</replaceable>
;
</optional>
<optional>
transfer-source (
<replaceable>
ip4_addr
</replaceable>
|
<constant>
*
</constant>
)
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
transfer-source-v6 (
<replaceable>
ip6_addr
</replaceable>
|
<constant>
*
</constant>
)
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
notify-source (
<replaceable>
ip4_addr
</replaceable>
|
<constant>
*
</constant>
)
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
notify-source-v6 (
<replaceable>
ip6_addr
</replaceable>
|
<constant>
*
</constant>
)
<optional>
port
<replaceable>
ip_port
</replaceable></optional>
;
</optional>
<optional>
zone-statistics
<replaceable>
yes_or_no
</replaceable>
;
</optional>
<optional>
sig-validity-interval
<replaceable>
number
</replaceable>
;
</optional>
<optional>
database
<replaceable>
string
</replaceable>
;
</optional>
...
...
@@ -3862,6 +3885,22 @@ needs to be specified in that <command>allow-transfer</command> option.</para></
<entry
colname =
"2"
><para>
Similar to transfer-source, but for zone transfers
performed using IPv6.
</para></entry>
</row>
<row
rowsep =
"0"
>
<entry
colname =
"1"
><para><command>
notify-source
</command></para></entry>
<entry
colname =
"2"
><para><command>
notify-source
</command>
determines
which local address and optionally UDP port, will be used to send NOTIFY
messages. If a
<command>
notify-source
</command>
is not specified then
then the
<command>
transfer-source
</command>
will be used, if neither
of these are set then the address and port used will be determined by
the
<command>
view
</command>
then the
<command>
options
</command>
blocks.
This address must appear in the remote end's
<command>
masters
</command>
zone clause.
</row>
<row
rowsep =
"0"
>
<entry
colname =
"1"
><para>
notify-source-v6
</para></entry>
<entry
colname =
"2"
><para>
Similar to notify-source, but notify messages
are sent using IPv6.
</para></entry>
</row>
</tbody>
</tgroup></informaltable></sect3>
<sect3
id=
"dynamic_update_policies"
><title>
Dynamic Update Policies
</title>
...
...
lib/dns/config/confctx.c
View file @
dfd7798d
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: confctx.c,v 1.10
3
2000/11/
1
5 0
1:30:12 gson
Exp $ */
/* $Id: confctx.c,v 1.10
4
2000/11/
2
5 0
2:43:47 marka
Exp $ */
#include <config.h>
...
...
@@ -1054,6 +1054,9 @@ dns_c_ctx_optionsprint(FILE *fp, int indent, dns_c_options_t *options)
ISC_TRUE
));
}
PRINT_IPANDPORT
(
notify_source
,
"notify-source"
);
PRINT_IPANDPORT
(
notify_source_v6
,
"notify-source-v6"
);
PRINT_IPANDPORT
(
transfer_source
,
"transfer-source"
);
PRINT_IPANDPORT
(
transfer_source_v6
,
"transfer-source-v6"
);
...
...
@@ -1581,6 +1584,8 @@ dns_c_ctx_optionsnew(isc_mem_t *mem, dns_c_options_t **options)
opts
->
notify_forward
=
NULL
;
#endif
/* NOMINUM_PUBLIC */
opts
->
notify_source
=
NULL
;
opts
->
notify_source_v6
=
NULL
;
opts
->
transfer_source
=
NULL
;
opts
->
transfer_source_v6
=
NULL
;
opts
->
query_source
=
NULL
;
...
...
@@ -1734,6 +1739,8 @@ dns_c_ctx_optionsdelete(dns_c_options_t **opts)
FREEFIELD
(
notify_forward
);
#endif
/* NOMINUM_PUBLIC */
FREEFIELD
(
notify_source
);
FREEFIELD
(
notify_source_v6
);
FREEFIELD
(
transfer_source
);
FREEFIELD
(
transfer_source_v6
);
FREEFIELD
(
query_source
);
...
...
@@ -1880,6 +1887,8 @@ BOOL_FUNCS(treatcrasspace, treat_cr_as_space)
BOOL_FUNCS
(
additionalfromauth
,
additional_from_auth
)
BOOL_FUNCS
(
additionalfromcache
,
additional_from_cache
)
SOCKADDR_FUNCS
(
notifysource
,
notify_source
)
SOCKADDR_FUNCS
(
notifysourcev6
,
notify_source_v6
)
SOCKADDR_FUNCS
(
transfersource
,
transfer_source
)
SOCKADDR_FUNCS
(
transfersourcev6
,
transfer_source_v6
)
SOCKADDR_FUNCS
(
querysource
,
query_source
)
...
...
lib/dns/config/confparser.y.dirty
View file @
dfd7798d
...
...
@@ -33,7 +33,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: confparser.y.dirty,v 1.3
1
2000/11/2
2 18:20:05 gson
Exp $ */
/* $Id: confparser.y.dirty,v 1.3
2
2000/11/2
5 02:43:48 marka
Exp $ */
#include <config.h>
...
...
@@ -361,6 +361,8 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult);
%token L_NDOTS
%token L_NO
%token L_NOTIFY
%token L_NOTIFY_SOURCE
%token L_NOTIFY_SOURCE_V6
#ifndef NOMINUM_PUBLIC
%token L_NOTIFY_FORWARD
#endif /* NOMINUM_PUBLIC */
...
...
@@ -1128,6 +1130,60 @@ option: /* Empty */
YYABORT;
}
}
| L_NOTIFY_SOURCE maybe_wild_ip4_only_addr
{
tmpres = dns_c_ctx_setnotifysource(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine notify-source");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set notify-source");
YYABORT;
}
}
| L_NOTIFY_SOURCE maybe_wild_ip4_only_addr L_PORT maybe_wild_port
{
isc_sockaddr_setport(&$2, $4);
tmpres = dns_c_ctx_setnotifysource(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine notify-source");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set notify-source");
YYABORT;
}
}
| L_NOTIFY_SOURCE_V6 maybe_wild_ip6_only_addr
{
tmpres = dns_c_ctx_setnotifysourcev6(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine notify-source-v6");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set notify-source-v6");
YYABORT;
}
}
| L_NOTIFY_SOURCE_V6 maybe_wild_ip6_only_addr L_PORT maybe_wild_port
{
isc_sockaddr_setport(&$2, $4);
tmpres = dns_c_ctx_setnotifysourcev6(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine notify-source-v6");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set notify-source-v6");
YYABORT;
}
}
#ifndef NOMINUM_PUBLIC
| L_ALLOW_NOTIFY L_LBRACE address_match_list L_RBRACE
{
...
...
@@ -4138,6 +4194,78 @@ view_option: L_FORWARD zone_forward_opt
YYABORT;
}
}
| L_NOTIFY_SOURCE maybe_wild_ip4_only_addr
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
INSIST(view != NULL);
tmpres = dns_c_view_setnotifysource(view, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine view notify-source");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set view notify-source");
YYABORT;
}
}
| L_NOTIFY_SOURCE maybe_wild_ip4_only_addr L_PORT maybe_wild_port
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
INSIST(view != NULL);
isc_sockaddr_setport(&$2, $4);
tmpres = dns_c_view_setnotifysource(view, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine view notify-source");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set view notify-source");
YYABORT;
}
}
| L_NOTIFY_SOURCE_V6 maybe_wild_ip6_only_addr
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
INSIST(view != NULL);
tmpres = dns_c_view_setnotifysourcev6(view, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine view "
"notify-source-v6");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set view notify-source-v6");
YYABORT;
}
}
| L_NOTIFY_SOURCE_V6 maybe_wild_ip6_only_addr L_PORT maybe_wild_port
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
INSIST(view != NULL);
isc_sockaddr_setport(&$2, $4);
tmpres = dns_c_view_setnotifysourcev6(view, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine view "
"notify-source-v6");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set view notify-source-v6");
YYABORT;
}
}
| L_MAX_TRANSFER_TIME_OUT L_INTEGER
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
...
...
@@ -4908,7 +5036,8 @@ zone_non_type_keywords: L_FILE | L_FILE_IXFR | L_IXFR_TMP | L_MASTERS |
L_MAINTAIN_IXFR_BASE | L_PUBKEY | L_ALSO_NOTIFY | L_DIALUP |
L_ENABLE_ZONE | L_DATABASE | L_PORT | L_MIN_RETRY_TIME |
L_MAX_RETRY_TIME | L_MIN_REFRESH_TIME | L_MAX_REFRESH_TIME |
L_ZONE_STATISTICS
L_ZONE_STATISTICS | L_NOTIFY_SOURCE |
L_NOTIFY_SOURCE_V6
#ifndef NOMINUM_PUBLIC
| L_ALLOW_NOTIFY | L_NOTIFY_FORWARD | L_MAX_NAMES
#endif /* NOMINUM_PUBLIC */
...
...
@@ -5058,6 +5187,78 @@ zone_option: L_FILE L_QSTRING
YYABORT;
}
}
| L_NOTIFY_SOURCE maybe_wild_ip4_only_addr
{
dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg);
INSIST(zone != NULL);
tmpres = dns_c_zone_setnotifysource(zone, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine zone notify-source");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set zone notify-source");
YYABORT;
}
}
| L_NOTIFY_SOURCE maybe_wild_ip4_only_addr L_PORT maybe_wild_port
{
dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg);
INSIST(zone != NULL);
isc_sockaddr_setport(&$2, $4);
tmpres = dns_c_zone_setnotifysource(zone, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine zone notify-source");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set zone notify-source");
YYABORT;
}
}
| L_NOTIFY_SOURCE_V6 maybe_wild_ip6_only_addr
{
dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg);
INSIST(zone != NULL);
tmpres = dns_c_zone_setnotifysourcev6(zone, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine zone "
"notify-source-v6");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set zone notify-source-v6");
YYABORT;
}
}
| L_NOTIFY_SOURCE_V6 maybe_wild_ip6_only_addr L_PORT maybe_wild_port
{
dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg);
INSIST(zone != NULL);
isc_sockaddr_setport(&$2, $4);
tmpres = dns_c_zone_setnotifysourcev6(zone, $2);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
"cannot redefine zone "
"notify-source-v6");
YYABORT;
} else if (tmpres != ISC_R_SUCCESS) {
parser_error(ISC_FALSE,
"failed to set zone notify-source-v6");
YYABORT;
}
}
| L_CHECK_NAMES check_names_opt
{
dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg);
...
...
@@ -6065,6 +6266,8 @@ static struct token keyword_tokens [] = {
{ "ndots", L_NDOTS },
{ "no", L_NO },
{ "notify", L_NOTIFY },
{ "notify-source", L_NOTIFY_SOURCE },
{ "notify-source-v6", L_NOTIFY_SOURCE_V6 },
#ifndef NOMINUM_PUBLIC
{ "notify-forward", L_NOTIFY_FORWARD },
#endif /* NOMINUM_PUBLIC */
...
...
lib/dns/config/confview.c
View file @
dfd7798d
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: confview.c,v 1.5
6
2000/11/
1
5
23:11:23 tale
Exp $ */
/* $Id: confview.c,v 1.5
7
2000/11/
2
5
02:43:50 marka
Exp $ */
#include <config.h>
...
...
@@ -507,6 +507,8 @@ dns_c_view_new(isc_mem_t *mem, const char *name, dns_rdataclass_t viewclass,
view
->
additional_from_cache
=
NULL
;
view
->
additional_from_auth
=
NULL
;
view
->
notify_source
=
NULL
;
view
->
notify_source_v6
=
NULL
;
view
->
transfer_source
=
NULL
;
view
->
transfer_source_v6
=
NULL
;
view
->
query_source
=
NULL
;
...
...
@@ -750,6 +752,9 @@ dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view) {
PRINT_AS_BOOLEAN
(
notify_forward
,
"notify-forward"
);
#endif
/* NOMINUM_PUBLIC */
PRINT_IPANDPORT
(
notify_source
,
"notify-source"
);
PRINT_IPANDPORT
(
notify_source_v6
,
"notify-source-v6"
);
PRINT_IPANDPORT
(
transfer_source
,
"transfer-source"
);
PRINT_IPANDPORT
(
transfer_source_v6
,
"transfer-source-v6"
);
...
...
@@ -902,6 +907,8 @@ dns_c_view_delete(dns_c_view_t **viewptr) {
FREEFIELD
(
additional_from_auth
);
FREEFIELD
(
additional_from_cache
);
FREEFIELD
(
notify_source
);
FREEFIELD
(
notify_source_v6
);
FREEFIELD
(
transfer_source
);
FREEFIELD
(
transfer_source_v6
);
FREEFIELD
(
query_source
);
...
...
@@ -1550,6 +1557,8 @@ BOOL_FUNCS(rfc2308type1, rfc2308_type1)
BOOL_FUNCS
(
additionalfromcache
,
additional_from_cache
)
BOOL_FUNCS
(
additionalfromauth
,
additional_from_auth
)
SOCKADDR_FUNCS
(
notifysource
,
notify_source
)
SOCKADDR_FUNCS
(
notifysourcev6
,
notify_source_v6
)
SOCKADDR_FUNCS
(
transfersource
,
transfer_source
)
SOCKADDR_FUNCS
(
transfersourcev6
,
transfer_source_v6
)
SOCKADDR_FUNCS
(
querysource
,
query_source
)
...
...
lib/dns/config/confzone.c
View file @
dfd7798d
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: confzone.c,v 1.6
4
2000/11/
1
5
23:12:27 tale
Exp $ */
/* $Id: confzone.c,v 1.6
5
2000/11/
2
5
02:43:51 marka
Exp $ */
#include <config.h>
...
...
@@ -52,6 +52,8 @@
#define MZ_TRANSFER_SOURCE_BIT 14
#define MZ_TRANSFER_SOURCE_V6_BIT 15
#define MZ_STATISTICS_BIT 16
#define MZ_NOTIFY_SOURCE_BIT 18
#define MZ_NOTIFY_SOURCE_V6_BIT 19
/*
* Bit positions in the dns_c_slavezone_t structure setflags field.
...
...
@@ -80,6 +82,8 @@
#define SZ_NOTIFY_RELAY_BIT 19
#endif
/* NOMINUM_PUBLIC */
#define SZ_STATISTICS_BIT 20
#define SZ_NOTIFY_SOURCE_BIT 21
#define SZ_NOTIFY_SOURCE_V6_BIT 22
/* Bit positions of the stub zones */
...
...
@@ -2909,6 +2913,230 @@ dns_c_zone_gettransfersourcev6(dns_c_zone_t *zone, isc_sockaddr_t *retval) {
}
/*
*
*/
isc_result_t
dns_c_zone_setnotifysource
(
dns_c_zone_t
*
zone
,
isc_sockaddr_t
newval
)
{
isc_boolean_t
existed
=
ISC_FALSE
;
REQUIRE
(
DNS_C_ZONE_VALID
(
zone
));
switch
(
zone
->
ztype
)
{
case
dns_c_zone_master
:
zone
->
u
.
mzone
.
notify_source
=
newval
;
existed
=
DNS_C_CHECKBIT
(
MZ_NOTIFY_SOURCE_BIT
,
&
zone
->
u
.
mzone
.
setflags
);
DNS_C_SETBIT
(
MZ_NOTIFY_SOURCE_BIT
,
&
zone
->
u
.
mzone
.
setflags
);
break
;
case
dns_c_zone_slave
:
zone
->
u
.
szone
.
notify_source
=
newval
;
existed
=
DNS_C_CHECKBIT
(
SZ_NOTIFY_SOURCE_BIT
,
&
zone
->
u
.
szone
.
setflags
);
DNS_C_SETBIT
(
SZ_NOTIFY_SOURCE_BIT
,
&
zone
->
u
.
szone
.
setflags
);
break
;
case
dns_c_zone_stub
:
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_CONFIG
,
DNS_LOGMODULE_CONFIG
,
ISC_LOG_CRITICAL
,
"stub zones do not have a "
"notify_source field"
);
return
(
ISC_R_FAILURE
);
case
dns_c_zone_hint
:
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_CONFIG
,
DNS_LOGMODULE_CONFIG
,
ISC_LOG_CRITICAL
,
"hint zones do not have a "
"notify_source field"
);
return
(
ISC_R_FAILURE
);
case
dns_c_zone_forward
:
isc_log_write
(
dns_lctx
,
DNS_LOGCATEGORY_CONFIG
,
DNS_LOGMODULE_CONFIG
,
ISC_LOG_CRITICAL
,
"forward zones do not have a "
"notify_source field"
);
return
(
ISC_R_FAILURE
);
}
return
(
existed
?
ISC_R_EXISTS
:
ISC_R_SUCCESS
);
}
/*
*
*/
isc_result_t
dns_c_zone_getnotifysource
(
dns_c_zone_t
*
zone
,
isc_sockaddr_t
*
retval
)
{
isc_result_t
res
=
ISC_R_SUCCESS
;
REQUIRE
(
DNS_C_ZONE_VALID
(
zone
));
REQUIRE
(
retval
!=
NULL
);
switch
(
zone
->
ztype
)
{
case
dns_c_zone_master
:
if
(
DNS_C_CHECKBIT
(
MZ_NOTIFY_SOURCE_BIT
,
&
zone
->
u
.
mzone
.
setflags
))
{
*
retval
=
zone
->
u
.
mzone
.
notify_source
;
res
=
ISC_R_SUCCESS
;
}
else
{
res
=
ISC_R_NOTFOUND
;
}
break
;
case
dns_c_zone_slave
: