Remove setting alternate transfer source

Remove parsing the configuration options 'alt-transfer-source',
'alt-transfer-source-v6', and 'use-alt-transfer-source', and remove
the corresponding code that implements the feature.
This commit is contained in:
Matthijs Mekking 2022-12-02 16:38:52 +01:00
parent 2638a2a29c
commit 5954ae6458
8 changed files with 13 additions and 214 deletions

View file

@ -208,8 +208,6 @@ options {\n\
allow-query-on {any;};\n\
allow-transfer {any;};\n\
# also-notify <none>\n\
alt-transfer-source *;\n\
alt-transfer-source-v6 *;\n\
check-integrity yes;\n\
check-mx-cname warn;\n\
check-sibling yes;\n\

View file

@ -1966,47 +1966,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
named_add_reserved_dispatch(named_g_server,
cfg_obj_assockaddr(obj));
obj = NULL;
result = named_config_get(maps, "alt-transfer-source", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
RETERR(dns_zone_setaltxfrsource4(mayberaw,
cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
RETERR(dns_zone_setaltxfrsource4dscp(mayberaw, dscp));
obj = NULL;
result = named_config_get(maps, "alt-transfer-source-v6", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
RETERR(dns_zone_setaltxfrsource6(mayberaw,
cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
RETERR(dns_zone_setaltxfrsource6dscp(mayberaw, dscp));
obj = NULL;
(void)named_config_get(maps, "use-alt-transfer-source", &obj);
if (obj == NULL) {
/*
* Default off when views are in use otherwise
* on for BIND 8 compatibility.
*/
view = dns_zone_getview(zone);
if (view != NULL && strcmp(view->name, "_default") == 0)
{
alt = true;
} else {
alt = false;
}
} else {
alt = cfg_obj_asboolean(obj);
}
dns_zone_setoption(mayberaw, DNS_ZONEOPT_USEALTXFRSRC, alt);
obj = NULL;
(void)named_config_get(maps, "try-tcp-refresh", &obj);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_TRYTCPREFRESH,

View file

@ -16,7 +16,6 @@ options {
query-source dscp 46 address 10.53.0.5;
notify-source 10.53.0.5 dscp 46;
transfer-source 10.53.0.5 dscp 46;
alt-transfer-source 10.53.0.5 dscp 46;
port @PORT@;
pid-file "named.pid";
listen-on dscp 46 { 10.53.0.5; };

View file

@ -16,7 +16,6 @@ options {
query-source dscp 46 address 10.53.0.7;
notify-source 10.53.0.7 dscp 47;
transfer-source 10.53.0.7 dscp 47;
alt-transfer-source 10.53.0.7 dscp 47;
port @PORT@;
pid-file "named.pid";
listen-on dscp 46 { 10.53.0.7; };
@ -31,6 +30,5 @@ zone "." {
file "root.bk";
transfer-source 10.53.0.7 dscp 46;
notify-source 10.53.0.7 dscp 46;
alt-transfer-source 10.53.0.7 dscp 46;
primaries { 10.53.0.4; };
};

View file

@ -49,7 +49,6 @@ zone "initially-unavailable" {
type mirror;
primaries { 10.53.0.2; };
file "initially-unavailable.db.mirror";
use-alt-transfer-source no;
};
zone "verify-axfr" {

View file

@ -71,8 +71,8 @@ typedef enum {
DNS_ZONEOPT_FATALNS = 1 << 4, /*%< DNS_ZONEOPT_CHECKNS is fatal */
DNS_ZONEOPT_MULTIMASTER = 1 << 5, /*%< this zone has multiple
primaries */
DNS_ZONEOPT_USEALTXFRSRC = 1 << 6, /*%< use alternate transfer sources
*/
DNS_ZONEOPT_USEALTXFRSRC = 1 << 6, /*%< use alternate transfer sources.
Obsoleted. */
DNS_ZONEOPT_CHECKNAMES = 1 << 7, /*%< check-names */
DNS_ZONEOPT_CHECKNAMESFAIL = 1 << 8, /*%< fatal check-name failures */
DNS_ZONEOPT_CHECKWILDCARD = 1 << 9, /*%< check for internal wildcards */
@ -804,8 +804,6 @@ dns_zone_setmaxretrytime(dns_zone_t *zone, uint32_t val);
isc_result_t
dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_result_t
dns_zone_setaltxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
/*%<
* Set the source address to be used in IPv4 zone transfers.
*
@ -819,8 +817,6 @@ dns_zone_setaltxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_sockaddr_t *
dns_zone_getxfrsource4(dns_zone_t *zone);
isc_sockaddr_t *
dns_zone_getaltxfrsource4(dns_zone_t *zone);
/*%<
* Returns the source address set by a previous dns_zone_setxfrsource4
* call, or the default of inaddr_any, port 0.
@ -831,10 +827,8 @@ dns_zone_getaltxfrsource4(dns_zone_t *zone);
isc_result_t
dns_zone_setxfrsource4dscp(dns_zone_t *zone, isc_dscp_t dscp);
isc_result_t
dns_zone_setaltxfrsource4dscp(dns_zone_t *zone, isc_dscp_t dscp);
/*%<
* Set the DSCP value associated with the transfer/alt-transfer source.
* Set the DSCP value associated with the transfer source.
*
* Require:
*\li 'zone' to be a valid zone.
@ -845,10 +839,8 @@ dns_zone_setaltxfrsource4dscp(dns_zone_t *zone, isc_dscp_t dscp);
isc_dscp_t
dns_zone_getxfrsource4dscp(dns_zone_t *zone);
isc_dscp_t
dns_zone_getaltxfrsource4dscp(dns_zone_t *zone);
/*%/
* Get the DSCP value associated with the transfer/alt-transfer source.
* Get the DSCP value associated with the transfer source.
*
* Require:
*\li 'zone' to be a valid zone.
@ -856,8 +848,6 @@ dns_zone_getaltxfrsource4dscp(dns_zone_t *zone);
isc_result_t
dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_result_t
dns_zone_setaltxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
/*%<
* Set the source address to be used in IPv6 zone transfers.
*
@ -871,8 +861,6 @@ dns_zone_setaltxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_sockaddr_t *
dns_zone_getxfrsource6(dns_zone_t *zone);
isc_sockaddr_t *
dns_zone_getaltxfrsource6(dns_zone_t *zone);
/*%<
* Returns the source address set by a previous dns_zone_setxfrsource6
* call, or the default of in6addr_any, port 0.
@ -883,10 +871,8 @@ dns_zone_getaltxfrsource6(dns_zone_t *zone);
isc_dscp_t
dns_zone_getxfrsource6dscp(dns_zone_t *zone);
isc_dscp_t
dns_zone_getaltxfrsource6dscp(dns_zone_t *zone);
/*%/
* Get the DSCP value associated with the transfer/alt-transfer source.
* Get the DSCP value associated with the transfer source.
*
* Require:
*\li 'zone' to be a valid zone.
@ -894,10 +880,8 @@ dns_zone_getaltxfrsource6dscp(dns_zone_t *zone);
isc_result_t
dns_zone_setxfrsource6dscp(dns_zone_t *zone, isc_dscp_t dscp);
isc_result_t
dns_zone_setaltxfrsource6dscp(dns_zone_t *zone, isc_dscp_t dscp);
/*%<
* Set the DSCP value associated with the transfer/alt-transfer source.
* Set the DSCP value associated with the transfer source.
*
* Require:
*\li 'zone' to be a valid zone.

View file

@ -334,8 +334,6 @@ struct dns_zone {
isc_sockaddr_t parentalsrc6;
isc_sockaddr_t xfrsource4;
isc_sockaddr_t xfrsource6;
isc_sockaddr_t altxfrsource4;
isc_sockaddr_t altxfrsource6;
isc_sockaddr_t sourceaddr;
isc_dscp_t notifysrc4dscp;
isc_dscp_t notifysrc6dscp;
@ -343,8 +341,6 @@ struct dns_zone {
isc_dscp_t parentalsrc6dscp;
isc_dscp_t xfrsource4dscp;
isc_dscp_t xfrsource6dscp;
isc_dscp_t altxfrsource4dscp;
isc_dscp_t altxfrsource6dscp;
dns_xfrin_ctx_t *xfr; /* task locked */
dns_tsigkey_t *tsigkey; /* key used for xfr */
@ -554,7 +550,7 @@ typedef enum {
DNS_ZONEFLG_NOIXFR = 0x00100000U, /*%< IXFR failed, force AXFR */
DNS_ZONEFLG_FLUSH = 0x00200000U,
DNS_ZONEFLG_NOEDNS = 0x00400000U,
DNS_ZONEFLG_USEALTXFRSRC = 0x00800000U,
DNS_ZONEFLG_USEALTXFRSRC = 0x00800000U, /*%< Obsoleted. */
DNS_ZONEFLG_SOABEFOREAXFR = 0x01000000U,
DNS_ZONEFLG_NEEDCOMPACT = 0x02000000U,
DNS_ZONEFLG_REFRESHING = 0x04000000U, /*%< Refreshing keydata */
@ -1128,8 +1124,6 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx, unsigned int tid) {
.parentalsrc6dscp = -1,
.xfrsource4dscp = -1,
.xfrsource6dscp = -1,
.altxfrsource4dscp = -1,
.altxfrsource6dscp = -1,
.maxxfrin = MAX_XFER_TIME,
.maxxfrout = MAX_XFER_TIME,
.sigvalidityinterval = 30 * 24 * 3600,
@ -1194,8 +1188,6 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx, unsigned int tid) {
isc_sockaddr_any6(&zone->parentalsrc6);
isc_sockaddr_any(&zone->xfrsource4);
isc_sockaddr_any6(&zone->xfrsource6);
isc_sockaddr_any(&zone->altxfrsource4);
isc_sockaddr_any6(&zone->altxfrsource6);
ISC_LINK_INIT(zone, statelink);
ISC_LIST_INIT(zone->signing);
ISC_LIST_INIT(zone->nsec3chain);
@ -6054,76 +6046,6 @@ dns_zone_setxfrsource6dscp(dns_zone_t *zone, isc_dscp_t dscp) {
return (ISC_R_SUCCESS);
}
isc_result_t
dns_zone_setaltxfrsource4(dns_zone_t *zone,
const isc_sockaddr_t *altxfrsource) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
zone->altxfrsource4 = *altxfrsource;
UNLOCK_ZONE(zone);
return (ISC_R_SUCCESS);
}
isc_sockaddr_t *
dns_zone_getaltxfrsource4(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (&zone->altxfrsource4);
}
isc_result_t
dns_zone_setaltxfrsource4dscp(dns_zone_t *zone, isc_dscp_t dscp) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
zone->altxfrsource4dscp = dscp;
UNLOCK_ZONE(zone);
return (ISC_R_SUCCESS);
}
isc_dscp_t
dns_zone_getaltxfrsource4dscp(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (zone->altxfrsource4dscp);
}
isc_result_t
dns_zone_setaltxfrsource6(dns_zone_t *zone,
const isc_sockaddr_t *altxfrsource) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
zone->altxfrsource6 = *altxfrsource;
UNLOCK_ZONE(zone);
return (ISC_R_SUCCESS);
}
isc_sockaddr_t *
dns_zone_getaltxfrsource6(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (&zone->altxfrsource6);
}
isc_result_t
dns_zone_setaltxfrsource6dscp(dns_zone_t *zone, isc_dscp_t dscp) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
zone->altxfrsource6dscp = dscp;
UNLOCK_ZONE(zone);
return (ISC_R_SUCCESS);
}
isc_dscp_t
dns_zone_getaltxfrsource6dscp(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (zone->altxfrsource6dscp);
}
isc_result_t
dns_zone_setparentalsrc4(dns_zone_t *zone, const isc_sockaddr_t *parentalsrc) {
REQUIRE(DNS_ZONE_VALID(zone));
@ -11644,7 +11566,6 @@ zone_refresh(dns_zone_t *zone) {
}
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_REFRESH);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NOEDNS);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
if ((oldflags & (DNS_ZONEFLG_REFRESH | DNS_ZONEFLG_LOADING)) != 0) {
return;
}
@ -13833,32 +13754,9 @@ next_primary:
dns_remote_next(&zone->primaries, true);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NOEDNS);
if (exiting || dns_remote_done(&zone->primaries)) {
bool done = true;
if (!exiting &&
DNS_ZONE_OPTION(zone, DNS_ZONEOPT_USEALTXFRSRC) &&
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_USEALTXFRSRC))
{
/*
* Did we get a good answer from all the primaries?
*/
done = dns_remote_allgood(&zone->primaries);
}
if (!done) {
dns_remote_reset(&zone->primaries, false);
/*
* Find the next failed primary.
*/
if (dns_remote_addrok(&zone->primaries)) {
dns_remote_next(&zone->primaries, true);
}
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
} else {
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
zone_settimer(zone, &now);
goto free_stub;
}
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
zone_settimer(zone, &now);
goto free_stub;
}
queue_soa_query(zone);
goto free_stub;
@ -14363,37 +14261,15 @@ next_primary:
dns_remote_next(&zone->primaries, true);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NOEDNS);
if (dns_remote_done(&zone->primaries)) {
bool done = true;
if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_USEALTXFRSRC) &&
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_USEALTXFRSRC))
{
/*
* Did we get a good answer from all the primaries?
*/
done = dns_remote_allgood(&zone->primaries);
}
if (!done) {
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
dns_remote_reset(&zone->primaries, false);
/*
* Find the next failed primary.
*/
if (dns_remote_addrok(&zone->primaries)) {
dns_remote_next(&zone->primaries, true);
}
goto requeue;
}
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDREFRESH)) {
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NEEDREFRESH);
zone->refreshtime = now;
}
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
zone_settimer(zone, &now);
goto detach;
}
requeue:
queue_soa_query(zone);
goto detach;
@ -17687,20 +17563,6 @@ again:
same_primary:
if (dns_remote_done(&zone->primaries)) {
dns_remote_reset(&zone->primaries, false);
if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_USEALTXFRSRC) &&
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_USEALTXFRSRC))
{
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_REFRESH);
DNS_ZONE_SETFLAG(zone,
DNS_ZONEFLG_USEALTXFRSRC);
if (dns_remote_addrok(&zone->primaries)) {
dns_remote_next(&zone->primaries, true);
}
again = true;
} else {
DNS_ZONE_CLRFLAG(zone,
DNS_ZONEFLG_USEALTXFRSRC);
}
} else {
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_REFRESH);
again = true;

View file

@ -2250,10 +2250,10 @@ static cfg_clausedef_t zone_clauses[] = {
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR },
{ "alt-transfer-source", &cfg_type_sockaddr4wild,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_CLAUSEFLAG_DEPRECATED },
CFG_CLAUSEFLAG_ANCIENT },
{ "alt-transfer-source-v6", &cfg_type_sockaddr6wild,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
CFG_CLAUSEFLAG_DEPRECATED },
CFG_CLAUSEFLAG_ANCIENT },
{ "auto-dnssec", &cfg_type_autodnssec,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_CLAUSEFLAG_DEPRECATED },
{ "check-dup-records", &cfg_type_checkmode, CFG_ZONE_PRIMARY },
@ -2361,7 +2361,7 @@ static cfg_clausedef_t zone_clauses[] = {
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY },
{ "use-alt-transfer-source", &cfg_type_boolean,
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB |
CFG_CLAUSEFLAG_DEPRECATED },
CFG_CLAUSEFLAG_ANCIENT },
{ "zero-no-soa-ttl", &cfg_type_boolean,
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR },
{ "zone-statistics", &cfg_type_zonestat,