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

4238. [bug] Don't send to servers on net zero (0.0.0.0/8).

[RT #40947]
This commit is contained in:
Mark Andrews
2015-10-16 08:00:15 +11:00
parent 567196d10a
commit 6588a2b404
9 changed files with 108 additions and 0 deletions

View File

@@ -419,6 +419,22 @@ isc_netaddr_issitelocal(isc_netaddr_t *na) {
}
}
#ifndef IN_ZERONET
#define IN_ZERONET(x) (((x) & htonl(0xff000000U)) == 0)
#endif
isc_boolean_t
isc_netaddr_isnetzero(isc_netaddr_t *na) {
switch (na->family) {
case AF_INET:
return (ISC_TF(IN_ZERONET(na->type.in.s_addr)));
case AF_INET6:
return (ISC_FALSE);
default:
return (ISC_FALSE);
}
}
void
isc_netaddr_fromv4mapped(isc_netaddr_t *t, const isc_netaddr_t *s) {
isc_netaddr_t *src;