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

[master] fix ECS with family==0

4341.	[bug]		Correct the handling of ECS options with
			address family 0. [RT #41377]
This commit is contained in:
Evan Hunt
2016-03-23 08:54:46 -07:00
parent 6e3f736f73
commit 395e6865d5
6 changed files with 83 additions and 24 deletions

View File

@@ -611,14 +611,14 @@ sendquery(struct query *query, isc_task_t *task)
if (sa->sa_family == AF_INET) {
family = 1;
sin = (struct sockaddr_in *) sa;
memcpy(addr, &sin->sin_addr, 4);
memmove(addr, &sin->sin_addr, 4);
if ((plen % 8) != 0)
addr[addrl-1] &=
~0 << (8 - (plen % 8));
} else {
family = 2;
sin6 = (struct sockaddr_in6 *) sa;
memcpy(addr, &sin6->sin6_addr, 16);
memmove(addr, &sin6->sin6_addr, 16);
}
/* Mask off last address byte */