From ad248f22614b35ed58347b02b856006292e2f0e5 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Tue, 13 Dec 2022 17:28:19 +0100 Subject: [PATCH] Add new 'source[-v6]' option for remote servers Add a new way to configure the preferred source address when talking to remote servers such as primaries and parental-agents. This will eventually deprecate options such as 'parental-source', 'parental-source-v6', 'transfer-source', etc. Example of the new configuration: parental-agents "parents" port 5353 \ source 10.10.10.10 port 5354 dscp 54 \ source-v6 2001:db8::10 port 5355 dscp 55 { 10.10.10.11; 2001:db8::11; }; --- bin/tests/system/checkconf/good.conf.in | 4 ++-- doc/man/named.conf.5in | 30 ++++++++++++------------- doc/misc/mirror.zoneopt | 4 ++-- doc/misc/options | 12 +++++----- doc/misc/primary.zoneopt | 4 ++-- doc/misc/redirect.zoneopt | 2 +- doc/misc/secondary.zoneopt | 6 ++--- doc/misc/stub.zoneopt | 2 +- lib/isccfg/namedconf.c | 20 +++++++++++++++++ 9 files changed, 52 insertions(+), 32 deletions(-) diff --git a/bin/tests/system/checkconf/good.conf.in b/bin/tests/system/checkconf/good.conf.in index 46b15a8559..8ecf392063 100644 --- a/bin/tests/system/checkconf/good.conf.in +++ b/bin/tests/system/checkconf/good.conf.in @@ -82,9 +82,9 @@ options { transfer-source 0.0.0.0 dscp 63; zone-statistics none; }; -parental-agents "parents" { +parental-agents "parents" port 5353 source 10.10.10.10 port 5354 dscp 54 source-v6 2001:db8::10 port 5355 dscp 55 { 10.10.10.11; - 10.10.10.12; + 2001:db8::11; }; view "first" { match-clients { diff --git a/doc/man/named.conf.5in b/doc/man/named.conf.5in index b03ef74839..a1fbfa5d3b 100644 --- a/doc/man/named.conf.5in +++ b/doc/man/named.conf.5in @@ -126,7 +126,7 @@ options { allow\-transfer [ port ] [ transport ] { ; ... }; allow\-update { ; ... }; allow\-update\-forwarding { ; ... }; - also\-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also\-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt\-transfer\-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt\-transfer\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated answer\-cookie ; @@ -138,7 +138,7 @@ options { avoid\-v6\-udp\-ports { ; ... }; bindkeys\-file ; blackhole { ; ... }; - catalog\-zones { zone [ default\-primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone\-directory ] [ in\-memory ] [ min\-update\-interval ]; ... }; + catalog\-zones { zone [ default\-primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone\-directory ] [ in\-memory ] [ min\-update\-interval ]; ... }; check\-dup\-records ( fail | warn | ignore ); check\-integrity ; check\-mx ( fail | warn | ignore ); @@ -373,11 +373,11 @@ options { zone\-statistics ( full | terse | none | ); }; -parental\-agents [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times +parental\-agents [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times plugin ( query ) [ { } ]; // may occur multiple times -primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times +primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times server { bogus ; @@ -437,13 +437,13 @@ view [ ] { allow\-transfer [ port ] [ transport ] { ; ... }; allow\-update { ; ... }; allow\-update\-forwarding { ; ... }; - also\-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also\-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt\-transfer\-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt\-transfer\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated attach\-cache ; auth\-nxdomain ; auto\-dnssec ( allow | maintain | off ); // deprecated - catalog\-zones { zone [ default\-primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone\-directory ] [ in\-memory ] [ min\-update\-interval ]; ... }; + catalog\-zones { zone [ default\-primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone\-directory ] [ in\-memory ] [ min\-update\-interval ]; ... }; check\-dup\-records ( fail | warn | ignore ); check\-integrity ; check\-mx ( fail | warn | ignore ); @@ -666,7 +666,7 @@ zone [ ] { allow\-query\-on { ; ... }; allow\-transfer [ port ] [ transport ] { ; ... }; allow\-update { ; ... }; - also\-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also\-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt\-transfer\-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt\-transfer\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated auto\-dnssec ( allow | maintain | off ); // deprecated @@ -710,7 +710,7 @@ zone [ ] { notify\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; notify\-to\-soa ; nsec3\-test\-zone ; // test only - parental\-agents [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + parental\-agents [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; parental\-source ( | * ) [ port ( | * ) ] [ dscp ]; parental\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; serial\-update\-method ( date | increment | unixtime ); @@ -740,7 +740,7 @@ zone [ ] { allow\-query\-on { ; ... }; allow\-transfer [ port ] [ transport ] { ; ... }; allow\-update\-forwarding { ; ... }; - also\-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also\-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt\-transfer\-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt\-transfer\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated auto\-dnssec ( allow | maintain | off ); // deprecated @@ -780,10 +780,10 @@ zone [ ] { notify\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; notify\-to\-soa ; nsec3\-test\-zone ; // test only - parental\-agents [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + parental\-agents [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; parental\-source ( | * ) [ port ( | * ) ] [ dscp ]; parental\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; request\-expire ; request\-ixfr ; sig\-signing\-nodes ; @@ -815,7 +815,7 @@ zone [ ] { allow\-query\-on { ; ... }; allow\-transfer [ port ] [ transport ] { ; ... }; allow\-update\-forwarding { ; ... }; - also\-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also\-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt\-transfer\-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt\-transfer\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated check\-names ( fail | warn | ignore ); @@ -841,7 +841,7 @@ zone [ ] { notify\-delay ; notify\-source ( | * ) [ port ( | * ) ] [ dscp ]; notify\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; request\-expire ; request\-ixfr ; transfer\-source ( | * ) [ port ( | * ) ] [ dscp ]; @@ -903,7 +903,7 @@ zone [ ] { masterfile\-style ( full | relative ); max\-records ; max\-zone\-ttl ( unlimited | ); // deprecated - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; zone\-statistics ( full | terse | none | ); }; @@ -958,7 +958,7 @@ zone [ ] { min\-refresh\-time ; min\-retry\-time ; multi\-master ; - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source\-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; transfer\-source ( | * ) [ port ( | * ) ] [ dscp ]; transfer\-source\-v6 ( | * ) [ port ( | * ) ] [ dscp ]; use\-alt\-transfer\-source ; // deprecated diff --git a/doc/misc/mirror.zoneopt b/doc/misc/mirror.zoneopt index 90a0b97a59..959a733193 100644 --- a/doc/misc/mirror.zoneopt +++ b/doc/misc/mirror.zoneopt @@ -5,7 +5,7 @@ zone [ ] { allow-query-on { ; ... }; allow-transfer [ port ] [ transport ] { ; ... }; allow-update-forwarding { ; ... }; - also-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt-transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt-transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated check-names ( fail | warn | ignore ); @@ -31,7 +31,7 @@ zone [ ] { notify-delay ; notify-source ( | * ) [ port ( | * ) ] [ dscp ]; notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; request-expire ; request-ixfr ; transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; diff --git a/doc/misc/options b/doc/misc/options index ce8f20a917..ea1f7d770f 100644 --- a/doc/misc/options +++ b/doc/misc/options @@ -69,7 +69,7 @@ options { allow-transfer [ port ] [ transport ] { ; ... }; allow-update { ; ... }; allow-update-forwarding { ; ... }; - also-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt-transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt-transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated answer-cookie ; @@ -81,7 +81,7 @@ options { avoid-v6-udp-ports { ; ... }; bindkeys-file ; blackhole { ; ... }; - catalog-zones { zone [ default-primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone-directory ] [ in-memory ] [ min-update-interval ]; ... }; + catalog-zones { zone [ default-primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone-directory ] [ in-memory ] [ min-update-interval ]; ... }; check-dup-records ( fail | warn | ignore ); check-integrity ; check-mx ( fail | warn | ignore ); @@ -316,11 +316,11 @@ options { zone-statistics ( full | terse | none | ); }; -parental-agents [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times +parental-agents [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times plugin ( query ) [ { } ]; // may occur multiple times -primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times +primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; // may occur multiple times server { bogus ; @@ -380,13 +380,13 @@ view [ ] { allow-transfer [ port ] [ transport ] { ; ... }; allow-update { ; ... }; allow-update-forwarding { ; ... }; - also-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt-transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt-transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated attach-cache ; auth-nxdomain ; auto-dnssec ( allow | maintain | off ); // deprecated - catalog-zones { zone [ default-primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone-directory ] [ in-memory ] [ min-update-interval ]; ... }; + catalog-zones { zone [ default-primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... } ] [ zone-directory ] [ in-memory ] [ min-update-interval ]; ... }; check-dup-records ( fail | warn | ignore ); check-integrity ; check-mx ( fail | warn | ignore ); diff --git a/doc/misc/primary.zoneopt b/doc/misc/primary.zoneopt index 78c3293442..75d1bccadf 100644 --- a/doc/misc/primary.zoneopt +++ b/doc/misc/primary.zoneopt @@ -4,7 +4,7 @@ zone [ ] { allow-query-on { ; ... }; allow-transfer [ port ] [ transport ] { ; ... }; allow-update { ; ... }; - also-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt-transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt-transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated auto-dnssec ( allow | maintain | off ); // deprecated @@ -48,7 +48,7 @@ zone [ ] { notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; notify-to-soa ; nsec3-test-zone ; // test only - parental-agents [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + parental-agents [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; parental-source ( | * ) [ port ( | * ) ] [ dscp ]; parental-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; serial-update-method ( date | increment | unixtime ); diff --git a/doc/misc/redirect.zoneopt b/doc/misc/redirect.zoneopt index 845ca96062..5103121cef 100644 --- a/doc/misc/redirect.zoneopt +++ b/doc/misc/redirect.zoneopt @@ -8,6 +8,6 @@ zone [ ] { masterfile-style ( full | relative ); max-records ; max-zone-ttl ( unlimited | ); // deprecated - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; zone-statistics ( full | terse | none | ); }; diff --git a/doc/misc/secondary.zoneopt b/doc/misc/secondary.zoneopt index 75c99e3973..f20c5d1d0c 100644 --- a/doc/misc/secondary.zoneopt +++ b/doc/misc/secondary.zoneopt @@ -5,7 +5,7 @@ zone [ ] { allow-query-on { ; ... }; allow-transfer [ port ] [ transport ] { ; ... }; allow-update-forwarding { ; ... }; - also-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + also-notify [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; alt-transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated alt-transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; // deprecated auto-dnssec ( allow | maintain | off ); // deprecated @@ -45,10 +45,10 @@ zone [ ] { notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; notify-to-soa ; nsec3-test-zone ; // test only - parental-agents [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + parental-agents [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; parental-source ( | * ) [ port ( | * ) ] [ dscp ]; parental-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; request-expire ; request-ixfr ; sig-signing-nodes ; diff --git a/doc/misc/stub.zoneopt b/doc/misc/stub.zoneopt index d5b0ba5144..74e2c73317 100644 --- a/doc/misc/stub.zoneopt +++ b/doc/misc/stub.zoneopt @@ -19,7 +19,7 @@ zone [ ] { min-refresh-time ; min-retry-time ; multi-master ; - primaries [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; + primaries [ port ] [ dscp ] [ source ( | * ) [ port ( | * ) ] [ dscp ] ] [ source-v6 ( | * ) [ port ( | * ) ] [ dscp ] ] { ( | [ port ] | [ port ] ) [ key ] [ tls ]; ... }; transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; use-alt-transfer-source ; // deprecated diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 0ea0cf151f..0f2cdd224b 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -121,6 +121,8 @@ static cfg_type_t cfg_type_optional_dscp; static cfg_type_t cfg_type_optional_facility; static cfg_type_t cfg_type_optional_keyref; static cfg_type_t cfg_type_optional_port; +static cfg_type_t cfg_type_optional_sourceaddr4; +static cfg_type_t cfg_type_optional_sourceaddr6; static cfg_type_t cfg_type_optional_uint32; static cfg_type_t cfg_type_optional_tls; static cfg_type_t cfg_type_options; @@ -234,6 +236,8 @@ static cfg_tuplefielddef_t remotes_fields[] = { { "name", &cfg_type_astring, 0 }, { "port", &cfg_type_optional_port, 0 }, { "dscp", &cfg_type_optional_dscp, 0 }, + { "source", &cfg_type_optional_sourceaddr4, 0 }, + { "source-v6", &cfg_type_optional_sourceaddr6, 0 }, { "addresses", &cfg_type_bracketed_namesockaddrkeylist, 0 }, { NULL, NULL, 0 } }; @@ -273,6 +277,8 @@ static cfg_type_t cfg_type_bracketed_namesockaddrkeylist = { static cfg_tuplefielddef_t namesockaddrkeylist_fields[] = { { "port", &cfg_type_optional_port, 0 }, { "dscp", &cfg_type_optional_dscp, 0 }, + { "source", &cfg_type_optional_sourceaddr4, 0 }, + { "source-v6", &cfg_type_optional_sourceaddr6, 0 }, { "addresses", &cfg_type_bracketed_namesockaddrkeylist, 0 }, { NULL, NULL, 0 } }; @@ -3573,6 +3579,20 @@ static cfg_type_t cfg_type_sockaddr6wild = { cfg_doc_sockaddr, &cfg_rep_sockaddr, &sockaddr6wild_flags }; +static keyword_type_t sourceaddr4_kw = { "source", &cfg_type_sockaddr4wild }; + +static cfg_type_t cfg_type_optional_sourceaddr4 = { + "optional_sourceaddr4", parse_optional_keyvalue, print_keyvalue, + doc_optional_keyvalue, &cfg_rep_sockaddr, &sourceaddr4_kw +}; + +static keyword_type_t sourceaddr6_kw = { "source-v6", &cfg_type_sockaddr6wild }; + +static cfg_type_t cfg_type_optional_sourceaddr6 = { + "optional_sourceaddr6", parse_optional_keyvalue, print_keyvalue, + doc_optional_keyvalue, &cfg_rep_sockaddr, &sourceaddr6_kw +}; + /*% * rndc */