dnsmasq: update filter-aaaa patch

This commit is contained in:
CN_SZTL 2020-03-08 20:24:44 +08:00
parent c8f8dc57ee
commit ee47429fbb
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -13,40 +13,41 @@ diff --git a/src/dnsmasq.h b/src/dnsmasq.h
index 1896a64..e10d6c4 100644
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -259,7 +259,8 @@ struct event_desc {
#define OPT_TFTP_APREF_MAC 56
#define OPT_RAPID_COMMIT 57
#define OPT_UBUS 58
-#define OPT_LAST 59
+#define OPT_FILTER_AAAA 59
+#define OPT_LAST 60
@@ -268,7 +268,8 @@
#define OPT_IGNORE_CLID 59
#define OPT_SINGLE_PORT 60
#define OPT_LEASE_RENEW 61
-#define OPT_LAST 62
+#define OPT_FILTER_AAAA 62
+#define OPT_LAST 63
#define OPTION_BITS (sizeof(unsigned int)*8)
#define OPTION_SIZE ( (OPT_LAST/OPTION_BITS)+((OPT_LAST%OPTION_BITS)!=0) )
#define OPTION_SIZE (
(OPT_LAST/OPTION_BITS)+((OPT_LAST%OPTION_BITS)!=0) )
diff --git a/src/option.c b/src/option.c
index d8c57d6..1cc65bf 100644
--- a/src/option.c
+++ b/src/option.c
@@ -166,6 +166,7 @@ struct myoption {
#define LOPT_UBUS 354
#define LOPT_NAME_MATCH 355
#define LOPT_CAA 356
+#define LOPT_FILTER_AAAA 357
@@ -167,6 +167,7 @@
#define LOPT_IGNORE_CLID 358
#define LOPT_SINGLE_PORT 359
#define LOPT_SCRIPT_TIME 360
+#define LOPT_FILTER_AAAA 361
#ifdef HAVE_GETOPT_LONG
static const struct option opts[] =
@@ -337,6 +338,7 @@ static const struct myoption opts[] =
{ "dhcp-rapid-commit", 0, 0, LOPT_RAPID_COMMIT },
@@ -339,6 +340,7 @@
{ "dumpfile", 1, 0, LOPT_DUMPFILE },
{ "dumpmask", 1, 0, LOPT_DUMPMASK },
+ { "filter-aaaa", 0, 0, LOPT_FILTER_AAAA },
{ "dhcp-ignore-clid", 0, 0, LOPT_IGNORE_CLID },
+ { "filter-aaaa", 0, 0, LOPT_FILTER_AAAA },
{ NULL, 0, 0, 0 }
};
@@ -515,6 +517,7 @@ static struct {
{ LOPT_RAPID_COMMIT, OPT_RAPID_COMMIT, NULL, gettext_noop("Enables DHCPv4 Rapid Commit option."), NULL },
@@ -518,6 +520,7 @@
{ LOPT_DUMPFILE, ARG_ONE, "<path>", gettext_noop("Path to debug packet dump file"), NULL },
{ LOPT_DUMPMASK, ARG_ONE, "<hex>", gettext_noop("Mask which packets to dump"), NULL },
{ LOPT_SCRIPT_TIME, OPT_LEASE_RENEW, NULL, gettext_noop("Call dhcp-script when lease expiry changes."), NULL },
+ { LOPT_FILTER_AAAA, OPT_FILTER_AAAA, NULL, gettext_noop("Filter all AAAA requests."), NULL },
{ 0, 0, NULL, NULL, NULL }
};
@ -55,7 +56,7 @@ diff --git a/src/rfc1035.c b/src/rfc1035.c
index 24d08c1..1594962 100644
--- a/src/rfc1035.c
+++ b/src/rfc1035.c
@@ -1970,6 +1970,15 @@ size_t answer_request(struct dns_header
@@ -1941,6 +1941,15 @@
}
}
@ -71,4 +72,4 @@ index 24d08c1..1594962 100644
if (!ans)
return 0; /* failed to answer a question */
}
--
--