From 81a128c7a13247762b80b3928c20532b914cbd4b Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Sat, 15 Oct 2005 19:05:39 +0000 Subject: [PATCH] * avahi-daemon: Only use multicast when looking up things in simple-protocol git-svn-id: file:///home/lennart/svn/public/avahi/trunk@781 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/simple-protocol.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c index d53987d..4844ca4 100644 --- a/avahi-daemon/simple-protocol.c +++ b/avahi-daemon/simple-protocol.c @@ -281,19 +281,19 @@ static void handle_line(Client *c, const char *s) { c->state = CLIENT_DEAD; } else if (strcmp(cmd, "RESOLVE-HOSTNAME-IPV4") == 0 && n_args == 2) { c->state = CLIENT_RESOLVE_HOSTNAME; - if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, arg, c->afquery = AVAHI_PROTO_INET, 0, host_name_resolver_callback, c))) + if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, arg, c->afquery = AVAHI_PROTO_INET, AVAHI_LOOKUP_USE_MULTICAST, host_name_resolver_callback, c))) goto fail; avahi_log_debug(__FILE__": Got %s request for '%s'.", cmd, arg); } else if (strcmp(cmd, "RESOLVE-HOSTNAME-IPV6") == 0 && n_args == 2) { c->state = CLIENT_RESOLVE_HOSTNAME; - if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, arg, c->afquery = AVAHI_PROTO_INET6, 0, host_name_resolver_callback, c))) + if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, arg, c->afquery = AVAHI_PROTO_INET6, AVAHI_LOOKUP_USE_MULTICAST, host_name_resolver_callback, c))) goto fail; avahi_log_debug(__FILE__": Got %s request for '%s'.", cmd, arg); } else if (strcmp(cmd, "RESOLVE-HOSTNAME") == 0 && n_args == 2) { c->state = CLIENT_RESOLVE_HOSTNAME; - if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, arg, c->afquery = AVAHI_PROTO_UNSPEC, 0, host_name_resolver_callback, c))) + if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, arg, c->afquery = AVAHI_PROTO_UNSPEC, AVAHI_LOOKUP_USE_MULTICAST, host_name_resolver_callback, c))) goto fail; avahi_log_debug(__FILE__": Got %s request for '%s'.", cmd, arg); @@ -305,7 +305,7 @@ static void handle_line(Client *c, const char *s) { c->state = CLIENT_DEAD; } else { c->state = CLIENT_RESOLVE_ADDRESS; - if (!(c->address_resolver = avahi_s_address_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, &addr, 0, address_resolver_callback, c))) + if (!(c->address_resolver = avahi_s_address_resolver_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, &addr, AVAHI_LOOKUP_USE_MULTICAST, address_resolver_callback, c))) goto fail; } @@ -313,7 +313,7 @@ static void handle_line(Client *c, const char *s) { } else if (strcmp(cmd, "BROWSE-DNS-SERVERS-IPV4") == 0 && n_args == 1) { c->state = CLIENT_BROWSE_DNS_SERVERS; - if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AVAHI_PROTO_INET, 0, dns_server_browser_callback, c))) + if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AVAHI_PROTO_INET, AVAHI_LOOKUP_USE_MULTICAST, dns_server_browser_callback, c))) goto fail; client_output_printf(c, "+ Browsing ...\n"); @@ -321,7 +321,7 @@ static void handle_line(Client *c, const char *s) { } else if (strcmp(cmd, "BROWSE-DNS-SERVERS-IPV6") == 0 && n_args == 1) { c->state = CLIENT_BROWSE_DNS_SERVERS; - if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AVAHI_PROTO_INET6, 0, dns_server_browser_callback, c))) + if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AVAHI_PROTO_INET6, AVAHI_LOOKUP_USE_MULTICAST, dns_server_browser_callback, c))) goto fail; client_output_printf(c, "+ Browsing ...\n"); @@ -329,7 +329,7 @@ static void handle_line(Client *c, const char *s) { } else if (strcmp(cmd, "BROWSE-DNS-SERVERS") == 0 && n_args == 1) { c->state = CLIENT_BROWSE_DNS_SERVERS; - if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AVAHI_PROTO_UNSPEC, 0, dns_server_browser_callback, c))) + if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AVAHI_PROTO_UNSPEC, AVAHI_LOOKUP_USE_MULTICAST, dns_server_browser_callback, c))) goto fail; client_output_printf(c, "+ Browsing ...\n"); @@ -521,7 +521,7 @@ void simple_protocol_restart_queries(void) { for (c = server->clients; c; c = c->clients_next) if (c->state == CLIENT_BROWSE_DNS_SERVERS && c->dns_server_browser) { avahi_s_dns_server_browser_free(c->dns_server_browser); - c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery, 0, dns_server_browser_callback, c); + c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery, AVAHI_LOOKUP_USE_MULTICAST, dns_server_browser_callback, c); } } -- 2.39.5