Add -4 and -6 options to set address family when resolving names

This commit is contained in:
Miroslav Lichvar
2009-10-13 13:10:28 +02:00
parent a7892a1a15
commit fbd20c429e
4 changed files with 25 additions and 1 deletions

5
main.c
View File

@@ -61,6 +61,7 @@
#include "refclock.h"
#include "clientlog.h"
#include "broadcast.h"
#include "nameserv.h"
/* ================================================== */
@@ -268,6 +269,10 @@ int main
exit(0);
} else if (!strcmp("-d", *argv)) {
debug = 1;
} else if (!strcmp("-4", *argv)) {
DNS_SetAddressFamily(IPADDR_INET4);
} else if (!strcmp("-6", *argv)) {
DNS_SetAddressFamily(IPADDR_INET6);
} else {
LOG(LOGS_WARN, LOGF_Main, "Unrecognized command line option [%s]", *argv);
}