diff --git a/src/context.c b/src/context.c index 10d6a066..34432780 100644 --- a/src/context.c +++ b/src/context.c @@ -1682,12 +1682,17 @@ getdns_context_set_namespaces(getdns_context *context, for (i = 0; i < namespace_count; i++) { if (namespaces[i] == GETDNS_NAMESPACE_NETBIOS || +#ifndef HAVE_MDNS_SUPPORT + namespaces[i] == GETDNS_NAMESPACE_MDNS || +#endif namespaces[i] == GETDNS_NAMESPACE_NIS) r = GETDNS_RETURN_NOT_IMPLEMENTED; else if (namespaces[i] != GETDNS_NAMESPACE_DNS && - namespaces[i] != GETDNS_NAMESPACE_LOCALNAMES && - namespaces[i] != GETDNS_NAMESPACE_MDNS) +#ifdef HAVE_MDNS_SUPPORT + namespaces[i] != GETDNS_NAMESPACE_MDNS && +#endif + namespaces[i] != GETDNS_NAMESPACE_LOCALNAMES ) return GETDNS_RETURN_CONTEXT_UPDATE_FAIL; } GETDNS_FREE(context->my_mf, context->namespaces); diff --git a/src/general.c b/src/general.c index d40e2b52..97a97dcf 100644 --- a/src/general.c +++ b/src/general.c @@ -477,6 +477,7 @@ getdns_general_ns(getdns_context *context, getdns_eventloop *loop, ( req, localnames_response); break; } +#ifdef HAVE_MDNS_SUPPORT } else if (context->namespaces[i] == GETDNS_NAMESPACE_MDNS) { /* Check whether the name belongs in the MDNS space */ if (!(r = _getdns_mdns_namespace_check(req))) @@ -497,6 +498,7 @@ getdns_general_ns(getdns_context *context, getdns_eventloop *loop, /* Stop processing more namespaces, since there was a match */ break; } +#endif /* HAVE_MDNS_SUPPORT */ } else if (context->namespaces[i] == GETDNS_NAMESPACE_DNS) { /* TODO: We will get a good return code here even if diff --git a/src/mdns.c b/src/mdns.c index 5e204ab5..36950f36 100644 --- a/src/mdns.c +++ b/src/mdns.c @@ -27,6 +27,8 @@ #include "util-internal.h" #include "mdns.h" +#ifdef HAVE_MDNS_SUPPORT + #ifdef USE_WINSOCK typedef u_short sa_family_t; #define _getdns_EWOULDBLOCK (WSAGetLastError() == WSATRY_AGAIN ||\ @@ -46,10 +48,12 @@ uint64_t _getdns_get_time_as_uintt64(); #define MDNS_MCAST_IPV4_LONG 0xE00000FB /* 224.0.0.251 */ #define MDNS_MCAST_PORT 5353 -static uint8_t mdns_mcast_ipv6[] = { - 0xFF, 0x02, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0xFB }; - +/* + * TODO: When we start supporting IPv6 with MDNS, need to define this: + * static uint8_t mdns_mcast_ipv6[] = { + * 0xFF, 0x02, 0, 0, 0, 0, 0, 0, + * 0, 0, 0, 0, 0, 0, 0, 0xFB }; + */ static uint8_t mdns_suffix_dot_local[] = { 5, 'l', 'o', 'c', 'a', 'l', 0 }; static uint8_t mdns_suffix_254_169_in_addr_arpa[] = { @@ -352,4 +356,6 @@ _getdns_mdns_namespace_check( ret = GETDNS_RETURN_GOOD; return ret; -} \ No newline at end of file +} + +#endif /* HAVE_MDNS_SUPPORT */ diff --git a/src/mdns.h b/src/mdns.h index 95458585..30ae3135 100644 --- a/src/mdns.h +++ b/src/mdns.h @@ -21,6 +21,7 @@ #ifndef MDNS_H #define MDNS_H +#ifdef HAVE_MDNS_SUPPORT #include "getdns/getdns.h" #include "types-internal.h" @@ -29,5 +30,6 @@ _getdns_submit_mdns_request(getdns_network_req *netreq); getdns_return_t _getdns_mdns_namespace_check(getdns_dns_req *dnsreq); +#endif /* HAVE_MDNS_SUPPORT */ -#endif /* MDNS_H */ \ No newline at end of file +#endif /* MDNS_H */