summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin2024-12-11 14:27:22 +0000
committerJohn Crispin2024-12-11 14:27:22 +0000
commita2b4979285a9d0d9c73c7649a5bbee9513f69bd9 (patch)
tree8449d6f4c7169d2ff2f9f3125947724121c12369
parent453773429dcfb4af4e939ac7d7b454d78bbc44dc (diff)
downloadmdnsd-a2b4979285a9d0d9c73c7649a5bbee9513f69bd9.tar.gz
service: announce all services in single dns answer
Annouce all services in single packet, and do not send single reply for each of the service while annoucing. The single reply is sent in response to specific service queries only. Signed-off-by: Rahul Thakur <rahul.thakur@iopsys.eu> Signed-off-by: John Crispin <john@phrozen.org>
-rw-r--r--service.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/service.c b/service.c
index 21bdc7b..1f81031 100644
--- a/service.c
+++ b/service.c
@@ -161,16 +161,18 @@ void
service_announce_services(struct interface *iface, struct sockaddr *to, int ttl)
{
struct service *s;
+ int count = 0;
+ dns_init_answer();
vlist_for_each_element(&announced_services, s, node) {
s->t = 0;
if (ttl) {
- dns_init_answer();
service_add_ptr(s->service, ttl);
- dns_send_answer(iface, to, C_DNS_SD);
+ count++;
}
- service_reply_single(iface, to, s, ttl, 0);
}
+ if (count)
+ dns_send_answer(iface, to, C_DNS_SD);
}
void