diff --git a/testmdnsd.c b/testmdnsd.c index 554b0b4..f56435b 100644 --- a/testmdnsd.c +++ b/testmdnsd.c @@ -339,13 +339,15 @@ main(int argc, char **argv) if (0 <= mdnsd_discover_service("_http._tcp.local", 5000, &svcinfo, &numserv)) { - struct hostent * hosts = read_hosts(numserv); + struct hostent * hosts = read_hosts(numserv+1); if (!hosts) { fprintf(stderr,"null hosts\n"); return 1; } //dump_hosts(hosts); struct hostent * p = hosts; + /* recognise own .local hostname */ + p = add_host(p, fullname, saddr); for (int i = 0; i < numserv; ++i) { struct in_addr it; it.s_addr = svcinfo[i].ipaddr;