2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

reject multicast packets

This commit is contained in:
Michael Graff
2000-06-15 18:26:28 +00:00
parent f64ded0ac7
commit c01c401217
2 changed files with 13 additions and 1 deletions

View File

@@ -825,6 +825,10 @@ client_request(isc_task_t *task, isc_event_t *event) {
} else {
client->attributes &= ~NS_CLIENTATTR_PKTINFO;
}
if ((devent->attributes & ISC_SOCKEVENTATTR_MULTICAST) != 0)
client->attributes |= NS_CLIENTATTR_MULTICAST;
else
client->attributes &= ~NS_CLIENTATTR_MULTICAST;
} else {
INSIST(TCP_CLIENT(client));
REQUIRE(event->ev_type == DNS_EVENT_TCPMSG);
@@ -846,7 +850,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
if (exit_check(client))
goto cleanup_serverlock;
client->state = NS_CLIENTSTATE_WORKING;
isc_stdtime_get(&client->requesttime);
client->now = client->requesttime;
@@ -860,6 +864,13 @@ client_request(isc_task_t *task, isc_event_t *event) {
goto cleanup_serverlock;
}
if ((client->attributes & NS_CLIENTATTR_MULTICAST) != 0) {
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(2),
"ignoring multicast request");
ns_client_error(client, DNS_R_REFUSED);
}
result = dns_message_parse(client->message, buffer, ISC_FALSE);
if (result != ISC_R_SUCCESS) {
ns_client_error(client, result);