From 70d82e00397c5699a9f37ed93678560116f8ac62 Mon Sep 17 00:00:00 2001 From: cheoleun moon Date: Mon, 27 Feb 2023 12:23:19 +0900 Subject: [PATCH] Imported Upstream version 2.88 Change-Id: I71efe884b7eb0d77b9804525cf3ac4f8eee40a30 --- CHANGELOG | 155 ++ COPYING | 43 +- Makefile | 16 +- VERSION | 2 +- contrib/Suse/README | 6 - contrib/Suse/README.susefirewall | 27 - contrib/Suse/dnsmasq-SuSE.patch | 23 - contrib/Suse/dnsmasq-suse.spec | 111 -- contrib/Suse/rc.dnsmasq-suse | 79 - contrib/lease-tools/dhcp_release.c | 1 + contrib/lease-tools/dhcp_release6.c | 37 +- dbus/DBus-interface | 13 + dnsmasq.conf.example | 10 + man/dnsmasq.8 | 189 ++- po/de.po | 1341 +++++++++-------- po/es.po | 1235 +++++++++------- po/fi.po | 1213 +++++++++------- po/fr.po | 1236 +++++++++------- po/id.po | 1251 +++++++++------- po/it.po | 1213 +++++++++------- po/ka.po | 2746 +++++++++++++++++++++++++++++++++++ po/no.po | 1233 +++++++++------- po/pl.po | 1235 +++++++++------- po/pt_BR.po | 1213 +++++++++------- po/ro.po | 1233 +++++++++------- src/arp.c | 2 +- src/auth.c | 52 +- src/blockdata.c | 4 +- src/bpf.c | 2 +- src/cache.c | 314 ++-- src/config.h | 17 +- src/conntrack.c | 2 +- src/crypto.c | 31 +- src/dbus.c | 199 ++- src/dhcp-common.c | 72 +- src/dhcp-protocol.h | 3 +- src/dhcp.c | 179 ++- src/dhcp6-protocol.h | 5 +- src/dhcp6.c | 97 +- src/dns-protocol.h | 2 +- src/dnsmasq.c | 102 +- src/dnsmasq.h | 189 ++- src/dnssec.c | 142 +- src/domain-match.c | 309 ++-- src/domain.c | 33 +- src/dump.c | 144 +- src/edns0.c | 142 +- src/forward.c | 1072 +++++++++----- src/hash-questions.c | 10 +- src/helper.c | 80 +- src/inotify.c | 144 +- src/ip6addr.h | 2 +- src/lease.c | 10 +- src/log.c | 25 +- src/loop.c | 2 +- src/metrics.c | 24 +- src/metrics.h | 5 +- src/netlink.c | 24 +- src/network.c | 128 +- src/nftset.c | 94 ++ src/option.c | 979 +++++++++---- src/outpacket.c | 2 +- src/pattern.c | 10 +- src/poll.c | 19 +- src/radv-protocol.h | 2 +- src/radv.c | 50 +- src/rfc1035.c | 343 +++-- src/rfc2131.c | 35 +- src/rfc3315.c | 295 ++-- src/rrfilter.c | 55 +- src/slaac.c | 2 +- src/tftp.c | 53 +- src/ubus.c | 2 +- src/util.c | 125 +- 74 files changed, 14139 insertions(+), 7356 deletions(-) delete mode 100644 contrib/Suse/README delete mode 100644 contrib/Suse/README.susefirewall delete mode 100644 contrib/Suse/dnsmasq-SuSE.patch delete mode 100644 contrib/Suse/dnsmasq-suse.spec delete mode 100644 contrib/Suse/rc.dnsmasq-suse create mode 100644 po/ka.po create mode 100644 src/nftset.c diff --git a/CHANGELOG b/CHANGELOG index 5e54df9..0f36a0f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,155 @@ +version 2.88 + Fix bug in --dynamic-host when an interface has /16 IPv4 + address. Thanks to Mark Dietzer for spotting this. + + Add --fast-dns-retry option. This gives dnsmasq the ability + to originate retries for upstream DNS queries itself, rather + than relying on the downstream client. This is most useful + when doing DNSSEC over unreliable upstream networks. It comes + with some cost in memory usage and network bandwidth. + + Add --use-stale-cache option. When set, if a DNS name exists + in the cache, but its time-to-live has expired, dnsmasq will + return the data anyway. (It attempts to refresh the + data with an upstream query after returning the stale data.) + This can improve speed and reliability. It comes + at the expense of sometimes returning out-of-date data and + less efficient cache utilisation, since old data cannot be + flushed when its TTL expires, so the cache becomes + strictly least-recently-used. + + Make --hostsdir (but NOT --dhcp-hostsdir and --dhcp-optsdir) + handle removal of whole files or entries within files. + Thanks to Dominik Derigs for the initial patches for this. + + Fix bug, introduced in 2.87, which could result in DNS + servers being removed from the configuration when reloading + server configuration from DBus, or re-reading /etc/resolv.conf + Only servers from the same source should be replaced, but some + servers from other sources (i.e., hard coded or another dynamic source) + could mysteriously disappear. Thanks to all reporting this, + but especially Christopher J. Madsen who reduced the problem + to an easily reproducible case which saved much labour in + finding it. + + Add --no-round-robin option. + + Allow domain names as well as IP addresses when specifying + upstream DNS servers. There are some gotchas associated with this + (it will mysteriously fail to work if the dnsmasq instance + being started is in the path from the system resolver to the DNS), + and a seemingly sensible configuration like + --server=domain.name@1.2.3.4 is unactionable if domain.name + only resolves to an IPv6 address). There are, however, + cases where is can be useful. Thanks to Dominik Derigs for + the patch. + + Handle DS records for unsupported crypto algorithms correctly. + Such a DS, as long as it is validated, should allow answers + in the domain it attests to be returned as unvalidated, and not + as a validation error. + + Optimise reading large numbers of --server options. When re-reading + upstream servers from /etc/resolv.conf or other sources that + can change dnsmasq tries to avoid memory fragmentation by re-using + existing records that are being re-read unchanged. This involves + seaching all the server records for each new one installed. + During startup this search is pointless, and can cause long + start times with thousands of --server options because the work + needed is O(n^2). Handle this case more intelligently. + Thanks to Ye Zhou for spotting the problem and an initial patch. + + If we detect that a DNS reply from upstream is malformed don't + return it to the requestor; send a SEVFAIL rcode instead. + + +version 2.87 + Allow arbitrary prefix lengths in --rev-server and + --domain=....,local + + Replace --address=/#/..... functionality which got + missed in the 2.86 domain search rewrite. + + Add --nftset option, like --ipset but for the newer nftables. + Thanks to Chen Zhenge for the patch. + + Add --filter-A and --filter-AAAA options, to remove IPv4 or IPv6 + addresses from DNS answers. + + Fix crash doing netbooting when --port is set to zero + to disable the DNS server. Thanks to Drexl Johannes + for the bug report. + + Generalise --dhcp-relay. Sending via broadcast/multicast is + now supported for both IPv4 and IPv6 and the configuration + syntax made easier (but backwards compatible). + + Add snooping of IPv6 prefix-delegations to the DHCP-relay system. + + Finesse parsing of --dhcp-remoteid and --dhcp-subscrid. To be treated + as hex, the pattern must consist of only hex digits AND contain + at least one ':'. Thanks to Bengt-Erik Sandstrom who tripped + over a pattern consisting of a decimal number which was interpreted + surprisingly. + + Include client address in TFTP file-not-found error reports. + Thanks to Stefan Rink for the initial patch, which has been + re-worked by me (srk). All bugs mine. + + Note in manpage the change in behaviour of -address. This behaviour + actually changed in v2.86, but was undocumented there. From 2.86 on, + (eg) --address=/example.com/1.2.3.4 ONLY applies to A queries. All other + types of query will be sent upstream. Pre 2.86, that would catch the + whole example.com domain and queries for other types would get + a local NODATA answer. The pre-2.86 behaviour is still available, + by configuring --address=/example.com/1.2.3.4 --local=/example.com/ + + Fix problem with binding DHCP sockets to an individual interface. + Despite the fact that the system call tales the interface _name_ as + a parameter, it actually, binds the socket to interface _index_. + Deleting the interface and creating a new one with the same name + leaves the socket bound to the old index. (Creating new sockets + always allocates a fresh index, they are not reused). We now + take this behaviour into account and keep up with changing indexes. + + Add --conf-script configuration option. + + Enhance --domain to accept, for instance, + --domain=net2.thekelleys.org.uk,eth2 so that hosts get a domain + which relects the interface they are attached to in a way which + doesn't require hard-coding addresses. Thanks to Sten Spans for + the idea. + + Fix write-after-free error in DHCPv6 server code. + CVE-2022-0934 refers. + + Add the ability to specify destination port in + DHCP-relay mode. This change also removes a previous bug + where --dhcp-alternate-port would affect the port used + to relay _to_ as well as the port being listened on. + The new feature allows configuration to provide bug-for-bug + compatibility, if required. Thanks to Damian Kaczkowski + for the feature suggestion. + + Bound the value of UDP packet size in the EDNS0 header of + forwarded queries to the configured or default value of + edns-packet-max. There's no point letting a client set a larger + value if we're unable to return the answer. Thanks to Bertie + Taylor for pointing out the problem and supplying the patch. + + Fix problem with the configuration + + --server=/some.domain/# --address=/#/ --server= + + This would return for queries in some.domain, rather than + forwarding the query via the default server. + + Tweak DHCPv6 relay code so that packets relayed towards a server + have source address on the server-facing network, not the + client facing network. Thanks to Luis Thomas for spotting this + and initial patch. + + version 2.86 Handle DHCPREBIND requests in the DHCPv6 server code. Thanks to Aichun Li for spotting this omission, and the initial @@ -92,6 +244,9 @@ version 2.86 of filename). Thanks to Ed Wildgoose for the initial patch and motivation for this. + Allow adding IP address to nftables set in addition to + ipset. + version 2.85 Fix problem with DNS retries in 2.83/2.84. diff --git a/COPYING b/COPYING index 60549be..d159169 100644 --- a/COPYING +++ b/COPYING @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE + + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -225,7 +225,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names: This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/Makefile b/Makefile index 0cd592e..48e8d3b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# dnsmasq is Copyright (c) 2000-2021 Simon Kelley +# dnsmasq is Copyright (c) 2000-2022 Simon Kelley # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -70,7 +70,9 @@ nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CO HAVE_NETTLEHASH $(PKG_CONFIG) --libs nettle` gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp` sunos_libs = `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi` -version = -DVERSION='\"`$(top)/bld/get-version $(top)`\"' +nft_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_NFTSET $(PKG_CONFIG) --cflags libnftables` +nft_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_NFTSET $(PKG_CONFIG) --libs libnftables` +version = -DVERSION='\"`$(top)/bld/get-version $(top)`\"' sum?=$(shell $(CC) -DDNSMASQ_COMPILE_OPTS $(COPTS) -E $(top)/$(SRC)/dnsmasq.h | ( md5sum 2>/dev/null || md5 ) | cut -f 1 -d ' ') sum!=$(CC) -DDNSMASQ_COMPILE_OPTS $(COPTS) -E $(top)/$(SRC)/dnsmasq.h | ( md5sum 2>/dev/null || md5 ) | cut -f 1 -d ' ' @@ -82,7 +84,7 @@ objs = cache.o rfc1035.o util.o option.o forward.o network.o \ dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o pattern.o \ domain.o dnssec.o blockdata.o tables.o loop.o inotify.o \ poll.o rrfilter.o edns0.o arp.o crypto.o dump.o ubus.o \ - metrics.o hash-questions.o domain-match.o + metrics.o hash-questions.o domain-match.o nftset.o hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \ dns-protocol.h radv-protocol.h ip6addr.h metrics.h @@ -90,8 +92,8 @@ hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \ all : $(BUILDDIR) @cd $(BUILDDIR) && $(MAKE) \ top="$(top)" \ - build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \ - build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) $(ubus_libs)" \ + build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags) $(nft_cflags)" \ + build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) $(ubus_libs) $(nft_libs)" \ -f $(top)/Makefile dnsmasq mostly_clean : @@ -115,8 +117,8 @@ all-i18n : $(BUILDDIR) @cd $(BUILDDIR) && $(MAKE) \ top="$(top)" \ i18n=-DLOCALEDIR=\'\"$(LOCALEDIR)\"\' \ - build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \ - build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) $(ubus_libs)" \ + build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags) $(nft_cflags)" \ + build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) $(ubus_libs) $(nft_libs)" \ -f $(top)/Makefile dnsmasq for f in `cd $(PO); echo *.po`; do \ cd $(top) && cd $(BUILDDIR) && $(MAKE) top="$(top)" -f $(top)/Makefile $${f%.po}.mo; \ diff --git a/VERSION b/VERSION index 81fd6fc..b2c4a0f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ - (HEAD -> master, tag: v2.86) + (HEAD -> master, tag: v2.88) diff --git a/contrib/Suse/README b/contrib/Suse/README deleted file mode 100644 index 3fdc186..0000000 --- a/contrib/Suse/README +++ /dev/null @@ -1,6 +0,0 @@ -This packaging is now unmaintained in the dnsmasq source: dnsmasq is -included in Suse proper, and up-to-date packages are now available -from - -ftp://ftp.suse.com/pub/people/ug/ - diff --git a/contrib/Suse/README.susefirewall b/contrib/Suse/README.susefirewall deleted file mode 100644 index 0b94108..0000000 --- a/contrib/Suse/README.susefirewall +++ /dev/null @@ -1,27 +0,0 @@ -This is a patch against SuSEfirewall2-3.1-206 (SuSE 9.x and older) -It fixes the dependency from the dns daemon name 'named' -After appending the patch, the SuSEfirewall is again able to autodetect -the dnsmasq named service. -This is a very old bug in the SuSEfirewall script. -The SuSE people think the name of the dns server will always 'named' - - ---- /sbin/SuSEfirewall2.orig 2004-01-23 13:30:09.000000000 +0100 -+++ /sbin/SuSEfirewall2 2004-01-23 13:31:56.000000000 +0100 -@@ -764,7 +764,7 @@ - echo 'FW_ALLOW_INCOMING_HIGHPORTS_UDP should be set to yes, if you are running a DNS server!' - - test "$FW_SERVICE_AUTODETECT" = yes -o "$FW_SERVICE_AUTODETECT" = dmz -o "$FW_SERVICE_AUTODETECT" = ext && { -- test "$FW_SERVICE_DNS" = no -a '!' "$START_NAMED" = no && check_srv named && { -+ test "$FW_SERVICE_DNS" = no -a '!' "$START_NAMED" = no && check_srv dnsmasq && { - echo -e 'Warning: detected activated named, enabling FW_SERVICE_DNS! - You still have to allow tcp/udp port 53 on internal, dmz and/or external.' - FW_SERVICE_DNS=$FW_SERVICE_AUTODETECT -@@ -878,7 +878,7 @@ - test -e /etc/resolv.conf || echo "Warning: /etc/resolv.conf not found" - # Get ports/IP bindings of NAMED/SQUID - test "$FW_SERVICE_DNS" = yes -o "$FW_SERVICE_DNS" = dmz -o "$FW_SERVICE_DNS" = ext -o "$START_NAMED" = yes && DNS_PORT=`$LSOF -i -n -P | \ -- $AWK -F: '/^named .* UDP / {print $2}'| $GREP -vw 53 | $SORT -un` -+ $AWK -F: '/^dnsmasq .* UDP / {print $2}'| $GREP -vw 53 | $SORT -un` - test "$FW_SERVICE_SQUID" = yes -o "$FW_SERVICE_SQUID" = dmz -o "$FW_SERVICE_SQUID" = ext -o "$START_SQUID" = yes && SQUID_PORT=`$LSOF -i -n -P | \ - $AWK -F: '/^squid .* UDP/ {print $2}'| $SORT -un` diff --git a/contrib/Suse/dnsmasq-SuSE.patch b/contrib/Suse/dnsmasq-SuSE.patch deleted file mode 100644 index 626245f..0000000 --- a/contrib/Suse/dnsmasq-SuSE.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- man/dnsmasq.8 2004-08-08 20:57:56.000000000 +0200 -+++ man/dnsmasq.8 2004-08-12 00:40:01.000000000 +0200 -@@ -69,7 +69,7 @@ - .TP - .B \-g, --group= - Specify the group which dnsmasq will run --as. The defaults to "dip", if available, to facilitate access to -+as. The defaults to "dialout", if available, to facilitate access to - /etc/ppp/resolv.conf which is not normally world readable. - .TP - .B \-v, --version ---- src/config.h 2004-08-11 11:39:18.000000000 +0200 -+++ src/config.h 2004-08-12 00:40:01.000000000 +0200 -@@ -44,7 +44,7 @@ - #endif - #define DEFLEASE 3600 /* default lease time, 1 hour */ - #define CHUSER "nobody" --#define CHGRP "dip" -+#define CHGRP "dialout" - #define DHCP_SERVER_PORT 67 - #define DHCP_CLIENT_PORT 68 - - diff --git a/contrib/Suse/dnsmasq-suse.spec b/contrib/Suse/dnsmasq-suse.spec deleted file mode 100644 index ff8ba8f..0000000 --- a/contrib/Suse/dnsmasq-suse.spec +++ /dev/null @@ -1,111 +0,0 @@ -############################################################################### -# -# General -# -############################################################################### - -Name: dnsmasq -Version: 2.33 -Release: 1 -Copyright: GPL -Group: Productivity/Networking/DNS/Servers -Vendor: Simon Kelley -Packager: Simon Kelley -URL: http://www.thekelleys.org.uk/dnsmasq -Provides: dns_daemon -Conflicts: bind bind8 bind9 -PreReq: %fillup_prereq %insserv_prereq -Autoreqprov: on -Source0: %{name}-%{version}.tar.bz2 -BuildRoot: /var/tmp/%{name}-%{version} -Summary: A lightweight caching nameserver - -%description -Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server. It -is designed to provide DNS and, optionally, DHCP, to a small network. It can -serve the names of local machines which are not in the global DNS. The DHCP -server integrates with the DNS server and allows machines with DHCP-allocated -addresses to appear in the DNS with names configured either in each host or -in a central configuration file. Dnsmasq supports static and dynamic DHCP -leases and BOOTP for network booting of diskless machines. - - - -############################################################################### -# -# Build -# -############################################################################### - -%prep -%setup -q -patch -p0 buf, packet->len, 0, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) - { - perror("sendto failed"); - exit(4); - } + fail_fatal("sendto failed", 4); recv_size = recvfrom(sock, response, sizeof(response), MSG_DONTWAIT, NULL, 0); if (recv_size == -1) @@ -367,16 +374,18 @@ int send_release_packet(const char* iface, struct dhcp6_packet* packet) else { perror("recvfrom"); + result = UNSPEC_FAIL; } } - - int16_t result = parse_packet(response, recv_size); - if (result == NOT_REPLY_CODE) + else { - sleep(1); - continue; + result = parse_packet(response, recv_size); + if (result == NOT_REPLY_CODE) + { + sleep(1); + continue; + } } - close(sock); return result; } diff --git a/dbus/DBus-interface b/dbus/DBus-interface index 954c5b9..59b41b1 100644 --- a/dbus/DBus-interface +++ b/dbus/DBus-interface @@ -48,6 +48,10 @@ SetBogusPrivOption ------------------ Takes boolean, sets or resets the --bogus-priv option. +SetLocaliseQueriesOption +------------------------ +Takes boolean, sets or resets the --localise-queries option. + SetServers ---------- Returns nothing. Takes a set of arguments representing the new @@ -248,6 +252,15 @@ GetMetrics Returns an array with various metrics for DNS and DHCP. +GetServerMetrics +---------------- + +Returns per-DNS-server metrics. + +ClearMetrics +------------ + +Clear call metric counters, global and per-server. 2. SIGNALS ---------- diff --git a/dnsmasq.conf.example b/dnsmasq.conf.example index bf19424..2047630 100644 --- a/dnsmasq.conf.example +++ b/dnsmasq.conf.example @@ -85,6 +85,16 @@ # subdomains to the vpn and search ipsets: #ipset=/yahoo.com/google.com/vpn,search +# Add the IPs of all queries to yahoo.com, google.com, and their +# subdomains to netfilters sets, which is equivalent to +# 'nft add element ip test vpn { ... }; nft add element ip test search { ... }' +#nftset=/yahoo.com/google.com/ip#test#vpn,ip#test#search + +# Use netfilters sets for both IPv4 and IPv6: +# This adds all addresses in *.yahoo.com to vpn4 and vpn6 for IPv4 and IPv6 addresses. +#nftset=/yahoo.com/4#ip#test#vpn4 +#nftset=/yahoo.com/6#ip#test#vpn6 + # You can control how dnsmasq talks to a server: this forces # queries to 10.1.2.3 to be routed via eth1 # server=10.1.2.3@eth1 diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 index 7ffccad..2495ed1 100644 --- a/man/dnsmasq.8 +++ b/man/dnsmasq.8 @@ -60,7 +60,8 @@ in alphabetical order. .TP .B --hostsdir= Read all the hosts files contained in the directory. New or changed files -are read automatically. See \fB--dhcp-hostsdir\fP for details. +are read automatically and modified and deleted files have removed records +automatically deleted. .TP .B \-E, --expand-hosts Add the domain to simple names (without a period) in /etc/hosts @@ -105,6 +106,16 @@ Dnsmasq limits the value of this option to one hour, unless recompiled. .B --auth-ttl=