summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9879d5f)
It seems mdns(d) was trying to support queries for two records with
following names:
1) _services._dns-sd._udp.local
2) _services._dns-sd._tcp.local
According to the RFC 6763 Section 9 only the first one should be used
and response PTR records should include services of both protocols: UDP
and TCP.
This fixes discovering TCP services as in practice no other software was
sending queries with _services._dns-sd._tcp.local.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin <john@phrozen.org>
case TYPE_PTR:
if (!strcmp(name, sdudp))
case TYPE_PTR:
if (!strcmp(name, sdudp))
- service_announce_services(iface, 0, announce_ttl);
- else if (!strcmp(name, sdtcp))
- service_announce_services(iface, 1, announce_ttl);
+ service_announce_services(iface, announce_ttl);
service_reply(iface, name, announce_ttl);
break;
service_reply(iface, name, announce_ttl);
break;
static struct blob_buf b;
static VLIST_TREE(services, avl_strcmp, service_update, false, false);
char *sdudp = "_services._dns-sd._udp.local";
static struct blob_buf b;
static VLIST_TREE(services, avl_strcmp, service_update, false, false);
char *sdudp = "_services._dns-sd._udp.local";
-char *sdtcp = "_services._dns-sd._tcp.local";
static int service_init_announce;
static const char *
static int service_init_announce;
static const char *
-service_announce_services(struct interface *iface, int tcp, int ttl)
+service_announce_services(struct interface *iface, int ttl)
{
struct service *s;
vlist_for_each_element(&services, s, node) {
{
struct service *s;
vlist_for_each_element(&services, s, node) {
- if (!strstr(s->service, "._tcp") && tcp)
- continue;
- if (!strstr(s->service, "._udp") && !tcp)
- continue;
s->t = 0;
if (ttl) {
dns_init_answer();
service_add_ptr(s->service, ttl);
s->t = 0;
if (ttl) {
dns_init_answer();
service_add_ptr(s->service, ttl);
- if (tcp)
- dns_send_answer(iface, sdtcp);
- else
- dns_send_answer(iface, sdudp);
+ dns_send_answer(iface, sdudp);
}
service_reply_single(iface, s, ttl, 0);
}
}
service_reply_single(iface, s, ttl, 0);
}
void
service_announce(struct interface *iface, int ttl)
{
void
service_announce(struct interface *iface, int ttl)
{
- service_announce_services(iface, 0, ttl);
- service_announce_services(iface, 1, ttl);
+ service_announce_services(iface, ttl);
#define _SERVICE_H__
extern char *sdudp;
#define _SERVICE_H__
extern char *sdudp;
extern void service_init(int announce);
extern void service_cleanup(void);
extern void service_announce(struct interface *iface, int ttl);
extern void service_reply(struct interface *iface, const char *match, int ttl);
extern void service_init(int announce);
extern void service_cleanup(void);
extern void service_announce(struct interface *iface, int ttl);
extern void service_reply(struct interface *iface, const char *match, int ttl);
-extern void service_announce_services(struct interface *iface, int tcp, int ttl);
+extern void service_announce_services(struct interface *iface, int ttl);