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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user