Check opcode of messages returned by dns_request_getresponse
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#include <dns/name.h>
|
||||
#include <dns/nsec.h>
|
||||
#include <dns/nsec3.h>
|
||||
#include <dns/opcode.h>
|
||||
#include <dns/peer.h>
|
||||
#include <dns/private.h>
|
||||
#include <dns/rcode.h>
|
||||
@@ -13181,6 +13182,23 @@ stub_glue_response_cb(isc_task_t *task, isc_event_t *event) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected opcode.
|
||||
*/
|
||||
if (msg->opcode != dns_opcode_query) {
|
||||
char opcode[128];
|
||||
isc_buffer_t rb;
|
||||
|
||||
isc_buffer_init(&rb, opcode, sizeof(opcode));
|
||||
(void)dns_opcode_totext(msg->rcode, &rb);
|
||||
|
||||
dns_zone_log(zone, ISC_LOG_INFO,
|
||||
"refreshing stub: "
|
||||
"unexpected opcode (%.*s) from %s (source %s)",
|
||||
(int)rb.used, opcode, master, source);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected rcode.
|
||||
*/
|
||||
@@ -13593,6 +13611,23 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
|
||||
goto next_master;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected opcode.
|
||||
*/
|
||||
if (msg->opcode != dns_opcode_query) {
|
||||
char opcode[128];
|
||||
isc_buffer_t rb;
|
||||
|
||||
isc_buffer_init(&rb, opcode, sizeof(opcode));
|
||||
(void)dns_opcode_totext(msg->rcode, &rb);
|
||||
|
||||
dns_zone_log(zone, ISC_LOG_INFO,
|
||||
"refreshing stub: "
|
||||
"unexpected opcode (%.*s) from %s (source %s)",
|
||||
(int)rb.used, opcode, master, source);
|
||||
goto next_master;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected rcode.
|
||||
*/
|
||||
@@ -13982,6 +14017,23 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
|
||||
goto next_master;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected opcode.
|
||||
*/
|
||||
if (msg->opcode != dns_opcode_query) {
|
||||
char opcode[128];
|
||||
isc_buffer_t rb;
|
||||
|
||||
isc_buffer_init(&rb, opcode, sizeof(opcode));
|
||||
(void)dns_opcode_totext(msg->rcode, &rb);
|
||||
|
||||
dns_zone_log(zone, ISC_LOG_INFO,
|
||||
"refresh: "
|
||||
"unexpected opcode (%.*s) from %s (source %s)",
|
||||
(int)rb.used, opcode, master, source);
|
||||
goto next_master;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected rcode.
|
||||
*/
|
||||
@@ -18221,6 +18273,23 @@ forward_callback(isc_task_t *task, isc_event_t *event) {
|
||||
goto next_master;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected opcode.
|
||||
*/
|
||||
if (msg->opcode != dns_opcode_update) {
|
||||
char opcode[128];
|
||||
isc_buffer_t rb;
|
||||
|
||||
isc_buffer_init(&rb, opcode, sizeof(opcode));
|
||||
(void)dns_opcode_totext(msg->rcode, &rb);
|
||||
|
||||
dns_zone_log(zone, ISC_LOG_INFO,
|
||||
"forwarding dynamic update: "
|
||||
"unexpected opcode (%.*s) from %s",
|
||||
(int)rb.used, opcode, master);
|
||||
goto next_master;
|
||||
}
|
||||
|
||||
switch (msg->rcode) {
|
||||
/*
|
||||
* Pass these rcodes back to client.
|
||||
|
||||
Reference in New Issue
Block a user