static bool nosoa = false;
static bool notcp = false;
static bool sigvalinsecs = false;
+static bool transferinsecs = false;
+static bool transferslowly = false;
+static bool transferstuck = false;
/*
* -4 and -6
}
} else if (!strcmp(option, "sigvalinsecs")) {
sigvalinsecs = true;
+ } else if (!strcmp(option, "transferinsecs")) {
+ transferinsecs = true;
+ } else if (!strcmp(option, "transferslowly")) {
+ transferslowly = true;
+ } else if (!strcmp(option, "transferstuck")) {
+ transferstuck = true;
} else if (!strncmp(option, "tat=", 4)) {
named_g_tat_interval = atoi(option + 4);
} else {
if (sigvalinsecs) {
ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, true);
}
+ if (transferinsecs) {
+ ns_server_setoption(sctx, NS_SERVER_TRANSFERINSECS, true);
+ }
+ if (transferslowly) {
+ ns_server_setoption(sctx, NS_SERVER_TRANSFERSLOWLY, true);
+ }
+ if (transferstuck) {
+ ns_server_setoption(sctx, NS_SERVER_TRANSFERSTUCK, true);
+ }
}
static void
int seconds;
dns_ttl_t maxttl = 0; /* unlimited */
dns_zone_t *mayberaw = (raw != NULL) ? raw : zone;
+ bool transferinsecs = ns_server_getoption(named_g_server->sctx,
+ NS_SERVER_TRANSFERINSECS);
i = 0;
if (zconfig != NULL) {
obj = NULL;
result = named_config_get(maps, "max-transfer-time-out", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- dns_zone_setmaxxfrout(zone, cfg_obj_asuint32(obj) * 60);
+ dns_zone_setmaxxfrout(
+ zone, transferinsecs ? cfg_obj_asuint32(obj)
+ : cfg_obj_asuint32(obj) * 60);
obj = NULL;
result = named_config_get(maps, "max-transfer-idle-out", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- dns_zone_setidleout(zone, cfg_obj_asuint32(obj) * 60);
+ dns_zone_setidleout(zone, transferinsecs
+ ? cfg_obj_asuint32(obj)
+ : cfg_obj_asuint32(obj) * 60);
obj = NULL;
result = named_config_get(maps, "max-journal-size", &obj);
obj = NULL;
result = named_config_get(maps, "max-transfer-time-in", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- dns_zone_setmaxxfrin(mayberaw, cfg_obj_asuint32(obj) * 60);
+ dns_zone_setmaxxfrin(
+ mayberaw, transferinsecs ? cfg_obj_asuint32(obj)
+ : cfg_obj_asuint32(obj) * 60);
obj = NULL;
result = named_config_get(maps, "max-transfer-idle-in", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- dns_zone_setidlein(mayberaw, cfg_obj_asuint32(obj) * 60);
+ dns_zone_setidlein(mayberaw,
+ transferinsecs ? cfg_obj_asuint32(obj)
+ : cfg_obj_asuint32(obj) * 60);
obj = NULL;
result = named_config_get(maps, "max-refresh-time", &obj);
#include <ns/types.h>
-#define NS_SERVER_LOGQUERIES 0x00000001U /*%< log queries */
-#define NS_SERVER_NOAA 0x00000002U /*%< -T noaa */
-#define NS_SERVER_NOSOA 0x00000004U /*%< -T nosoa */
-#define NS_SERVER_NONEAREST 0x00000008U /*%< -T nonearest */
-#define NS_SERVER_NOEDNS 0x00000020U /*%< -T noedns */
-#define NS_SERVER_DROPEDNS 0x00000040U /*%< -T dropedns */
-#define NS_SERVER_NOTCP 0x00000080U /*%< -T notcp */
-#define NS_SERVER_DISABLE4 0x00000100U /*%< -6 */
-#define NS_SERVER_DISABLE6 0x00000200U /*%< -4 */
-#define NS_SERVER_FIXEDLOCAL 0x00000400U /*%< -T fixedlocal */
-#define NS_SERVER_SIGVALINSECS 0x00000800U /*%< -T sigvalinsecs */
-#define NS_SERVER_EDNSFORMERR 0x00001000U /*%< -T ednsformerr (STD13) */
-#define NS_SERVER_EDNSNOTIMP 0x00002000U /*%< -T ednsnotimp */
-#define NS_SERVER_EDNSREFUSED 0x00004000U /*%< -T ednsrefused */
+#define NS_SERVER_LOGQUERIES 0x00000001U /*%< log queries */
+#define NS_SERVER_NOAA 0x00000002U /*%< -T noaa */
+#define NS_SERVER_NOSOA 0x00000004U /*%< -T nosoa */
+#define NS_SERVER_NONEAREST 0x00000008U /*%< -T nonearest */
+#define NS_SERVER_NOEDNS 0x00000020U /*%< -T noedns */
+#define NS_SERVER_DROPEDNS 0x00000040U /*%< -T dropedns */
+#define NS_SERVER_NOTCP 0x00000080U /*%< -T notcp */
+#define NS_SERVER_DISABLE4 0x00000100U /*%< -6 */
+#define NS_SERVER_DISABLE6 0x00000200U /*%< -4 */
+#define NS_SERVER_FIXEDLOCAL 0x00000400U /*%< -T fixedlocal */
+#define NS_SERVER_SIGVALINSECS 0x00000800U /*%< -T sigvalinsecs */
+#define NS_SERVER_EDNSFORMERR 0x00001000U /*%< -T ednsformerr (STD13) */
+#define NS_SERVER_EDNSNOTIMP 0x00002000U /*%< -T ednsnotimp */
+#define NS_SERVER_EDNSREFUSED 0x00004000U /*%< -T ednsrefused */
+#define NS_SERVER_TRANSFERINSECS 0x00008000U /*%< -T transferinsecs */
+#define NS_SERVER_TRANSFERSLOWLY 0x00010000U /*%< -T transferslowly */
+#define NS_SERVER_TRANSFERSTUCK 0x00020000U /*%< -T transferstuck */
/*%
* Type for callback function to get hostname.
xfrout_log(xfr, ISC_LOG_DEBUG(8),
"sending TCP message of %d bytes", used.length);
+ /* System test helper options to simulate network issues. */
+ if (ns_server_getoption(xfr->client->manager->sctx,
+ NS_SERVER_TRANSFERSLOWLY))
+ {
+ /* Sleep for a bit over a second. */
+ select(0, NULL, NULL, NULL,
+ &(struct timeval){ 1, 1000 });
+ }
+ if (ns_server_getoption(xfr->client->manager->sctx,
+ NS_SERVER_TRANSFERSTUCK))
+ {
+ /* Sleep for a bit over a minute. */
+ select(0, NULL, NULL, NULL,
+ &(struct timeval){ 60, 1000 });
+ }
+
isc_nmhandle_attach(xfr->client->handle,
&xfr->client->sendhandle);
if (xfr->idletime > 0) {
xfr->cbytes = used.length;
} else {
xfrout_log(xfr, ISC_LOG_DEBUG(8), "sending IXFR UDP response");
+
+ /* System test helper options to simulate network issues. */
+ if (ns_server_getoption(xfr->client->manager->sctx,
+ NS_SERVER_TRANSFERSLOWLY))
+ {
+ /* Sleep for a bit over a second. */
+ select(0, NULL, NULL, NULL,
+ &(struct timeval){ 1, 1000 });
+ }
+ if (ns_server_getoption(xfr->client->manager->sctx,
+ NS_SERVER_TRANSFERSTUCK))
+ {
+ /* Sleep for a bit over a minute. */
+ select(0, NULL, NULL, NULL,
+ &(struct timeval){ 60, 1000 });
+ }
+
ns_client_send(xfr->client);
xfr->stream->methods->pause(xfr->stream);
isc_nmhandle_detach(&xfr->client->reqhandle);