Commit Graph

1534 Commits

Author SHA1 Message Date
Simon Kelley
1fd56c0e33 Tidy up CNAME representaion.
Use an explicit discriminator for the target union.
2019-10-30 12:58:28 +00:00
Simon Kelley
376cb97685 Extend non-terminal name handling to all locally configured RRs. 2019-10-29 22:58:55 +00:00
Simon Kelley
84449bf41c Generalise locally-configured CNAME handling.
It's now possible for the target of a CNAME to be any locally
configured RR or even point to a non-existent RR.
2019-10-29 22:24:19 +00:00
Dominik DL6ER
456a319775 DHCPv6 IAID should be of unsigned type. It is derived from strtoul() in lease.c:read_leases() and already now interpreted as unsigned in helper.c:276 and outpacket.c:put_opt6_long(). RFC3315 (section 22.4) shows that the IAID is 4 bytes long so we do not need to go up to unsigned long.
Signed-off-by: Dominik DL6ER <dl6er@dl6er.de>
2019-10-25 22:00:35 +01:00
Simon Kelley
157d8cfd6a Don't silently discard all-zeroes adddresses in --host-record. 2019-10-25 17:46:49 +01:00
Simon Kelley
1292e1a557 Don't waste time caching zero-TTL DNS records. 2019-10-25 17:31:53 +01:00
Simon Kelley
122997da54 Fix bugs in caching CNAMEs with target to SRV records. 2019-10-25 17:23:56 +01:00
Simon Kelley
b59a5c2567 Generalise CNAME handling.
Cope with cached and configured CNAMES for all record types we
support, including local-config but not cached types such as TXT.

Also, if we have a locally configured CNAME but no target for the
requested type, don't forward the query.
2019-10-25 16:13:38 +01:00
Geert Stappers
2a20cc6da8 Man page typo. 2019-10-22 18:20:56 +01:00
Simon Kelley
936bd82755 Fix too small control array in tftp code on BSD and SOLARIS
This causes tftp to fail on some BSD versions, for sure. It
works by chance on others.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241068
2019-10-12 23:29:59 +01:00
Florent Fourcot
13a58f9590 Add dhcp-ignore-clid configuration option
The idea of this option was already discussed years ago on the mailing
list:
https://dnsmasq-discuss.thekelleys.org.narkive.com/ZoFQNaGo/always-ignore-client-identifier#post4

In our production environnement, we discovered that some devices are
using 'client identifier' not unique at all, resulting on IP addresses
conflicts between several devices (we saw up to four devices using same
IP address).

The root cause is probably a buggy operating system/configuration of
decices, but this patch add a configuration workaround on server side
when fixing clients is impossible.

Signed-off-by: Charles Daymand <charles.daymand@wifirst.fr>
Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
2019-10-12 22:16:40 +01:00
Simon Kelley
19b0e3bf21 Check for REFUSED and SERVFAIL replies to DNSKEY queries. 2019-10-12 21:54:37 +01:00
Simon Kelley
203ce0a081 Update to 04db1483d1 2019-10-12 21:41:20 +01:00
Simon Kelley
e3002bf1a6 Add missing dump_packet() for DNSSEC query retries. 2019-10-11 23:30:08 +01:00
Simon Kelley
04db1483d1 Fix crash on REFUSED answers to DNSSEC queries.
Some REFUSED answers to DNSSEC-originated queries would
bypass the DNSSEC code entirely, and be returned as answers
to the original query. In the process, they'd mess up datastructures
so that a retry of the original query would crash dnsmasq.
2019-10-11 23:22:17 +01:00
Petr Menšík
6fe436a448 Report error on dhcp_release
If no IPv4 address is present on given interface, the tool would not
send any request. It would not report any error at the same time. Report
error if request send failed.

Signed-off-by: Petr Mensik <pemensik@redhat.com>
2019-10-07 18:19:19 +01:00
Alin Nastac
e710c34469 Fix crash when negative SRV response over TCP gets stored in LRU cache entry.
Patch extended to receive side of pipe by SRK.
2019-09-30 15:30:26 +01:00
Simon Kelley
defd6b1d85 Fix 90d7c6b97d CAP_NET_RAW, not CAP_NET_ADMIN. 2019-09-16 23:02:12 +01:00
Simon Kelley
90d7c6b97d Keep suitable capabilities if we may bind server sockets to interface or port. 2019-09-14 21:13:03 +01:00
Simon Kelley
e24abf28a2 Fix botch in ae7a3b9d2e
Loop variable must count up from zero, now we're using it as
an array index.
2019-09-03 22:48:39 +01:00
Simon Kelley
69a0477b74 DNSSEC: unsigned RRs in the auth section are not bogus.
Even if they are in a signed zone.
2019-09-03 16:49:02 +01:00
Simon Kelley
ae7a3b9d2e DNSSEC: implement RFC-4036 para 5.3.3. rules on TTL values. 2019-09-03 14:40:47 +01:00
Brian Haley
d9f882bea2 Change dhcp_release to use default address when no IP subnet matches
Currently, dhcp_release will only send a 'fake' release
when the address given is in the same subnet as an IP
on the interface that was given.

This doesn't work in an environment where dnsmasq is
managing leases for remote subnets via a DHCP relay, as
running dhcp_release locally will just cause it to
silently exit without doing anything, leaving the lease
in the database.

Change it to use the default IP on the interface, as the
dnsmasq source code at src/dhcp.c does, if no matching subnet
IP is found, as a fall-back.  This fixes an issue we are
seeing in certain Openstack deployments where we are using
dnsmasq to provision baremetal systems in a datacenter.

While using Dbus might have seemed like an obvious solution,
because of our extensive use of network namespaces (which
Dbus doesn't support), this seemed like a better solution
than creating system.d policy files for each dnsmasq we
might spawn and using --enable-dbus=$id in order to isolate
messages to specific dnsmasq instances.

Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
2019-08-30 21:21:57 +01:00
Simon Kelley
fef2f1c75e DNSSEC: Unsigned RRs in auth section proving that a DS doesn't exist are OK.
In a reply proving that a DS doesn't exist, it doesn't matter if RRs
in the auth section _other_ than NSEC/NSEC3 are not signed. We can't
set the AD flag when returning the query, but it still proves
that the DS doesn't exist for internal use.

As one of the RRs which may not be signed is the SOA record, use the
TTL of the NSEC record to cache the negative result, not one
derived from the SOA.

Thanks to Tore Anderson for spotting and diagnosing the bug.
2019-08-29 21:59:00 +01:00
Simon Kelley
5a91334985 Debian package: link against libidn2. 2019-08-23 22:31:30 +01:00
Simon Kelley
e198fe833a Compilation fix for MacOS.
Thanks to Pal Lockheart <ex@palx.org> for the original patch.
2019-08-22 23:23:29 +01:00
Simon Kelley
248efe8410 Truncate stupidly large cache sizes.
If the cache size is very large, the malloc() call will overflow
on 32 bit platforms and dnsmasq will crash. Limit to an order of
magnitude less.

Thanks to Lili Xu for spotting this.
2019-08-20 23:36:49 +01:00
Simon Kelley
dc6a57ffb8 Always force AD bit to zero in authoritative DNS answers. 2019-08-20 23:17:27 +01:00
Fabrice Fontaine
240da59f73 Makefile: fix i18n build with ubus
Commit caf4d571e6 forgot adding
ubus_libs to build_libs for all-i18n target

Fixes:
 - http://autobuild.buildroot.org/results/c0b27754b7ede024c095bdf0b3616e6f6be48c6d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-08-16 16:31:41 +01:00
Simon Kelley
5a56233f53 CHANGELOG update for ab73a746a0 2019-08-14 21:53:59 +01:00
Simon Kelley
225accd235 Fix breakage of dhcp_lease_time utility. 2019-08-14 21:52:50 +01:00
Vladislav Grishenko
ab73a746a0 Fix build with libnettle 3.5 2019-08-14 21:36:52 +01:00
Simon Kelley
69bc94779c Fix memory leak in helper.c
Thanks to Xu Mingjie <xumingjie1995@outlook.com> for spotting this.
2019-08-14 20:44:50 +01:00
Jiri Slaby
3052ce208a Fix build after y2038 changes in glib.
SIOCGSTAMP is defined in linux/sockios.h, not asm/sockios.h now.
2019-07-24 17:34:48 +01:00
Simon Kelley
18e17665fd Merge branch 'master' of ssh://thekelleys.org.uk/var/local/git/dnsmasq 2019-07-24 17:20:26 +01:00
Simon Kelley
05299fdd5a Fix wrong return code from explore_rrset() with some errors. 2019-07-15 22:04:20 +01:00
Simon Kelley
7ef55691a2 Replace ash shell with dash in contrib/reverse-dns. 2019-04-08 17:17:07 +01:00
Simon Kelley
7509f94fc4 Debian startup fix. 2019-04-08 17:05:27 +01:00
Simon Kelley
343b7b4ad0 Support multiple daemon instances with systemd in Debian. 2019-04-08 16:50:13 +01:00
Jan Willem Janssen
a2b8220f4e Improved UBus supported
- aligned the handling of UBus connections with the DBus code as it
makes it a bit easier to comprehend;
- added logging to the various UBus calls to aid debugging from an
enduser point of view, but be careful to not flood the logs;
- show the (lack of) support for UBus in the configuration string.
2019-04-04 15:58:07 +01:00
Simon Kelley
5c464ef62e Allow more then one --conf-file on the command line. 2019-03-29 23:11:05 +00:00
Simon Kelley
5fc639cf9a Don't retry close() syscalls after an EINTR errors.
http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2019q1/012953.html
2019-03-29 21:29:43 +00:00
Simon Kelley
7673013d23 Apply fix from c6cc455dd1 in DHCP code. 2019-03-28 22:04:10 +00:00
Jérémie Courrèges-Anglas
c6cc455dd1 Fix cmsg(3) API usage on OpenBSD
msg_controllen should be set using CMSG_SPACE() to account for padding.
RFC3542 provides more details:

  While sending an application may or may not include padding at the end
  of last ancillary data in msg_controllen and implementations must
  accept both as valid.

At least OpenBSD rejects control messages if msg_controllen doesn't
account for padding, so use CMSG_SPACE() for maximal portability.  This
is consistent with the example provided in the Linux cmsg(3) manpage.
2019-03-28 21:49:48 +00:00
Simon Kelley
1da81f7e23 CHANGELOG typo fix. 2019-03-28 13:51:11 +00:00
Simon Kelley
ae5b7e04a1 Add --shared-network DHCP configuration. 2019-03-27 22:33:28 +00:00
Simon Kelley
305ffb5ef0 Improve kernel-capability manipulation code under Linux.
Dnsmasq now fails early if a required capability is not available,
and tries not to request capabilities not required by its
configuration.
2019-03-16 18:17:17 +00:00
Simon Kelley
608aa9fcfc Support TCP fastopen on incoming and outgoing connections. 2019-03-10 22:52:54 +00:00
Dominik DL6ER
c61c7bb225 Remove redundant prototypes from dnsmasq.h
Dear Simon,

the attached patch removes three redundant prototypes from dnsmasq.h. There is no functional change.

Best regards,
Dominik

From c0b2ccfd20c4eec9d09468fdfe9b4ca8a8f8591e Mon Sep 17 00:00:00 2001
From: DL6ER <dl6er@dl6er.de>
Date: Sun, 10 Mar 2019 19:34:07 +0100
Subject: [PATCH] Remove redundant prototypes from dnsmasq.h

Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-03-10 20:31:57 +00:00
Simon Kelley
5ed82ae5f2 Remove unclear gcc-ism in conditional expression. 2019-03-05 16:38:34 +00:00