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

Add helper function isc_sockaddr_disabled

This commit is contained in:
Mark Andrews
2024-02-13 11:42:44 +11:00
parent 50a2c308d6
commit 9be1873ef3
2 changed files with 19 additions and 0 deletions

View File

@@ -467,3 +467,15 @@ isc_sockaddr_fromsockaddr(isc_sockaddr_t *isa, const struct sockaddr *sa) {
return (ISC_R_SUCCESS);
}
bool
isc_sockaddr_disabled(const isc_sockaddr_t *sockaddr) {
if ((sockaddr->type.sa.sa_family == AF_INET &&
isc_net_probeipv4() == ISC_R_DISABLED) ||
(sockaddr->type.sa.sa_family == AF_INET6 &&
isc_net_probeipv6() == ISC_R_DISABLED))
{
return (true);
}
return (false);
}