/*
* Deal with EDNS.
*/
- opt = dns_message_getopt(client->message);
+ if (ns_g_noedns)
+ opt = NULL;
+ else
+ opt = dns_message_getopt(client->message);
if (opt != NULL) {
+ /*
+ * Are we dropping all EDNS queries?
+ */
+ if (ns_g_dropedns) {
+ ns_client_next(client, ISC_R_SUCCESS);
+ goto cleanup;
+ }
/*
* Set the client's UDP buffer size.
*/
EXTERN isc_time_t ns_g_boottime;
EXTERN isc_boolean_t ns_g_memstatistics INIT(ISC_FALSE);
EXTERN isc_boolean_t ns_g_clienttest INIT(ISC_FALSE);
+EXTERN isc_boolean_t ns_g_dropedns INIT(ISC_FALSE);
+EXTERN isc_boolean_t ns_g_noedns INIT(ISC_FALSE);
EXTERN isc_boolean_t ns_g_nosoa INIT(ISC_FALSE);
EXTERN isc_boolean_t ns_g_noaa INIT(ISC_FALSE);
EXTERN unsigned int ns_g_delay INIT(0);
maxudp = 512;
else if (!strcmp(isc_commandline_argument, "maxudp1460"))
maxudp = 1460;
+ else if (!strcmp(isc_commandline_argument, "dropedns"))
+ ns_g_dropedns = ISC_TRUE;
+ else if (!strcmp(isc_commandline_argument, "noedns"))
+ ns_g_noedns = ISC_TRUE;
+ else if (!strncmp(isc_commandline_argument,
+ "maxudp=", 7))
+ maxudp = atoi(isc_commandline_argument + 7);
else if (!strncmp(isc_commandline_argument,
"delay=", 6))
ns_g_delay = atoi(isc_commandline_argument + 6);
my $tries = 0;
while (1) {
- my $return = system("$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd -p 5300 version.bind. chaos txt \@10.53.0.$n > dig.out");
+ my $return = system("$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noedns -p 5300 version.bind. chaos txt \@10.53.0.$n > dig.out");
last if ($return == 0);
if (++$tries >= 30) {
print `grep ";" dig.out > /dev/null`;
}
/*
* Simulate a firewall blocking UDP responses bigger than
- * 512 bytes.
+ * 'maxudp' bytes.
*/
if (sock->manager->maxudp != 0 && cc > sock->manager->maxudp)
return (DOIO_SOFT);
build_msghdr_send(sock, dev, &msghdr, iov, &write_count);
resend:
- cc = sendmsg(sock->fd, &msghdr, 0);
+ if (sock->type == isc_sockettype_udp &&
+ sock->manager->maxudp != 0 &&
+ write_count > (size_t)sock->manager->maxudp)
+ cc = write_count;
+ else
+ cc = sendmsg(sock->fd, &msghdr, 0);
send_errno = errno;
/*