From ac320e87d5993fe4cf1871a91a5dc557d69da50e Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 29 Aug 2014 21:24:35 +0200 Subject: [PATCH] add -4 and -6 options Signed-off-by: John Crispin --- dns.h | 1 + main.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dns.h b/dns.h index da4fb21..5937f26 100644 --- a/dns.h +++ b/dns.h @@ -68,6 +68,7 @@ struct dns_question { } __attribute__((packed, aligned(2))); struct interface; +extern int cfg_proto; void dns_send_question(struct interface *iface, const char *question, int type); void dns_init_answer(void); diff --git a/main.c b/main.c index 4747eef..0f976ad 100644 --- a/main.c +++ b/main.c @@ -37,6 +37,8 @@ #include "announce.h" #include "interface.h" +int cfg_proto = 0; + static void signal_shutdown(int signal) { @@ -50,7 +52,7 @@ main(int argc, char **argv) uloop_init(); - while ((ch = getopt(argc, argv, "t:i:d")) != -1) { + while ((ch = getopt(argc, argv, "t:i:d46")) != -1) { switch (ch) { case 't': ttl = atoi(optarg); @@ -65,6 +67,13 @@ main(int argc, char **argv) case 'i': interface_add(optarg); break; + case '4': + fprintf(stderr, "%s:%s[%d]\n", __FILE__, __func__, __LINE__); + cfg_proto = 4; + break; + case '6': + cfg_proto = 6; + break; default: return -1; } -- 2.25.1