for (i = servers; i; i = i->servers_next)
if (i->interface == interface || interface <= 0) {
+ DNSServerInfo *j;
char *t;
+ /* Filter out double entries */
+ for (j = servers; j != i; j = j->servers_next)
+ if (j->interface == interface || interface <= 0)
+ if (strcmp(i->address, j->address) == 0)
+ break;
+
+ if (j != i)
+ continue;
+
if (!r)
t = avahi_strdup(i->address);
else
AvahiIfIndex interface;
AvahiProtocol protocol;
int i_interface, i_protocol, port;
- char a[64];
+ char a[AVAHI_ADDRESS_STR_MAX];
assert(state == BROWSING);
return -1;
}
- if (sscanf(l+1, "%i %i %64s %i", &i_interface, &i_protocol, a, &port) != 4) {
+ if (sscanf(l+1, "%i %i %39s %i", &i_interface, &i_protocol, a, &port) != 4) {
daemon_log(LOG_ERR, "Failed to parse browsing line: %s", l);
return -1;
}
{ "version", no_argument, NULL, 'V' },
{ "refresh", no_argument, NULL, 'r' },
{ "check", no_argument, NULL, 'c' },
+ { NULL, 0, NULL, 0 }
};
- opterr = 0;
while ((c = getopt_long(argc, argv, "hDkVrc", long_options, NULL)) >= 0) {
switch(c) {
command = DAEMON_CHECK;
break;
default:
- fprintf(stderr, "Invalid command line argument: %c\n", c);
return -1;
}
}
/** Parent **/
if ((ret = daemon_retval_wait(20)) < 0) {
- daemon_log(LOG_ERR, "Could not recieve return value from daemon process.");
+ daemon_log(LOG_ERR, "Could not receive return value from daemon process.");
goto finish;
}