Commit Graph
93 Commits
Author SHA1 Message Date
Simon Kelley c8e8f5c204 Bump copyright notices for 2021. Happy New Year! 2021-01-24 21:59:37 +00:00
Simon Kelley 2a8710ac2f Update copyrights to 2020. 2020-01-05 16:40:06 +00:00
Simon Kelley 7673013d23 Apply fix from c6cc455dd1 in DHCP code. 2019-03-28 22:04:10 +00:00
Simon Kelley ae5b7e04a1 Add --shared-network DHCP configuration. 2019-03-27 22:33:28 +00:00
Simon Kelley 9c0d445ef4 Fix e7bfd556c0 to actually work. 2019-01-09 18:04:39 +00:00
Simon Kelley cc921df9ce Remove nested struct/union in cache records and all_addr. 2019-01-02 22:48:59 +00:00
Simon Kelley e7bfd556c0 Alter DHCP address selection after DECLINE in consec-addr mode.
Avoid offering the same address after a recieving a DECLINE message
to stop an infinite protocol loop. This has long been done in
default address allocation mode: this adds similar behaviour
when allocaing addresses consecutively.
2018-12-31 20:51:15 +00:00
Petr Menšík 47b45b2967 Fix lengths of interface names
Use helper function similar to copy correctly limited names into
buffers.
2018-09-04 22:47:58 +01:00
Simon Kelley 0669ee7a69 Fix DHCP broken-ness when --no-ping AND --dhcp-sequential-ip are set. 2018-05-04 16:46:24 +01:00
Simon Kelley d1ced3ae38 Update copyrights to 2018. 2018-01-01 22:18:03 +00:00
Simon Kelley 1649f709e7 Fix DHCP relay, broken by ff325644c7
Thanks to John Fitzgibbon for initial patch.
2017-06-25 21:19:30 +01:00
Simon Kelley 50ca85504c Bump year in copyrights. 2017-06-24 22:43:18 +01:00
Simon Kelley 7ab78b937f Fix c7be0164ce 2017-05-11 20:33:21 +01:00
Simon Kelley c7be0164ce Suppress DHCP ping checks when allocating on the loopback interface. 2017-05-10 22:21:53 +01:00
Simon Kelley 5ce3e76fbf DHCPv4: do ICMP-ping check in all cases other that current lease. 2017-04-28 22:14:20 +01:00
Floris Bos 503c609149 --dhcp-reply-delay option to workaround PXE client bugs.
Adds option to delay replying to DHCP packets by one or more seconds.
This provides a workaround for a PXE boot firmware implementation
that has a bug causing it to fail if it receives a (proxy) DHCP
reply instantly.

On Linux it looks up the exact receive time of the UDP packet with
the SIOCGSTAMP ioctl to prevent multiple delays if multiple packets
come in around the same time.
2017-04-09 23:07:13 +01:00
klemens 43517fcaf5 Spelling fixes. 2017-02-19 15:53:37 +00:00
Josh Soref 730c6745f0 Comprehensive spelling/typo fixes.
Thanks to Josh Soref for generating these fixes.
2017-02-06 16:14:04 +00:00
Simon Kelley e94ad0fa01 Suppress useless warning about DHCP packets of interfaces without addresses.
This only makes sense for interfaces which we're configured to listen on.
Thanks to Andrew Shadura for bug report.
2016-08-28 18:09:17 +01:00
Neil Jerram ff325644c7 Fix for DHCP in transmission interface when --bridge-interface in use.
From f3d832b41f44c856003517c583fbd7af4dca722c Mon Sep 17 00:00:00 2001
From: Neil Jerram <Neil.Jerram@metaswitch.com>
Date: Fri, 8 Apr 2016 19:23:47 +0100
Subject: [PATCH] Fix DHCPv4 reply via --bridge-interface alias interface

Sending a DHCPv4 reply through a --bridge-interface alias interface
was inadvertently broken by

  commit 65c7212000
  Author: Lung-Pin Chang <changlp@cs.nctu.edu.tw>
  Date:   Thu Mar 19 23:22:21 2015 +0000

      dhcp: set outbound interface via cmsg in unicast reply

        If multiple routes to the same network exist, Linux blindly picks
        the first interface (route) based on destination address, which might not be
        the one we're actually offering leases. Rather than relying on this,
        always set the interface for outgoing unicast DHCP packets.

because in the aliasing case, iface_index is changed from the index of
the interface on which the packet was received, to be the interface
index of the 'bridge' interface (where the DHCP context is expected to
be defined, and so needs to be looked up).

For the cmsg code that the cited commit added, we need the original
iface_index; so this commit saves that off before the aliasing code
can change it, as rcvd_iface_index, and then uses rcvd_iface_index
instead of iface_index for the cmsg code.
2016-05-03 22:49:46 +01:00
Simon Kelley d6b749af91 Fix typo in SDBM hash function.
Thanks to Luis Carvalho for spotting the error.
2016-04-25 17:05:15 +01:00
Simon Kelley c49778df4a Update copyright notices. Happy new year! 2016-01-06 18:52:33 +00:00
Simon Kelley 98079ea898 Catch errors from sendmsg in DHCP code.
Logs, eg,  iptables DROPS of dest 255.255.255.255
2015-10-13 20:32:21 +01:00
Neil Jerram 4918bd5505 Documenation updates for --bridge-interface and "off-link". 2015-06-10 22:23:20 +01:00
Neil Jerram 654f59e762 Fix logging of unknown interface in --bridge-interface, DHPCv4. 2015-06-10 22:06:33 +01:00
Lung-Pin Chang 65c7212000 dhcp: set outbound interface via cmsg in unicast reply
If multiple routes to the same network exist, Linux blindly picks
  the first interface (route) based on destination address, which might not be
  the one we're actually offering leases. Rather than relying on this,
  always set the interface for outgoing unicast DHCP packets.
2015-03-19 23:22:21 +00:00
Simon Kelley ff841ebf5a Fix boilerplate code for re-running system calls on EINTR and EAGAIN etc.
The nasty code with static variable in retry_send() which
avoids looping forever needs to be called on success of the syscall,
to reset the static variable.
2015-03-11 21:36:30 +00:00
Simon Kelley aff3396280 Update copyrights for dawn of 2015. 2015-01-31 20:13:40 +00:00
Neil Jerram 70772c9091 Allow wildcard aliases in --bridge-interface option
This is useful when using dnsmasq as DHCP server for a set of VMs
whose data is routed by the host instead of being bridged.  In this
scenario:

- There is an unbounded set of TAP interfaces that have no IP address
  at the host end.

- DHCP allocation is done from an IPv4 address range associated with a
  dummy interface.

- We run dnsmasq with --interface dummy --interface tap*
  --bind-dynamic, so that it listens on all the TAP interfaces, and
  --bridge-interface=dummy,tap*, so that it will allocate IP addresses
  via the TAP interfaces from the range associated with the dummy
  interface.
2014-06-11 21:22:40 +01:00
Simon Kelley 2f4c4b6076 LOG error of ARP-injection fails. 2014-05-23 20:44:59 +01:00
Simon Kelley c47e3ba446 Update copyright for 2014. 2014-01-08 17:07:54 +00:00
Simon Kelley 89500e31f1 Support MAC addresses in dhcp-host and dhcp-mac for DHCPv6. 2013-09-20 16:29:20 +01:00
Simon Kelley ff7eea27e7 Add --dhcp-relay config option. 2013-09-04 18:01:38 +01:00
Simon Kelley ffbad34b31 Set SOREUSEADDR as well as SOREUSEPORT on DHCP sockets when both available. 2013-08-14 15:53:57 +01:00
Simon Kelley 3f2873d42c Handle IPv4 interface-address labels in Linux. 2013-05-14 11:28:47 +01:00
Simon Kelley 56a1142f03 SO_REUSEPORT may be defined, but not supported. 2013-04-02 17:02:58 +01:00
Simon Kelley 49333cbdbe Allow trailing '*' wildcard in interface names. 2013-03-15 20:30:51 +00:00
Simon Kelley 61744359de Change copyright messages to include 2013. 2013-01-31 14:34:40 +00:00
Simon Kelley 4f7b304f53 Initial code to do authoritative DNS. 2012-11-28 21:27:02 +00:00
Simon Kelley c4a7f90ebb Config parsing error-handling update. 2012-07-12 20:52:12 +01:00
Simon Kelley 8bc4cecee6 Remove libvirt-inspired but never used access control features. 2012-07-03 21:04:11 +01:00
Simon Kelley 54dd393f39 Add --bind-dynamic 2012-06-20 11:23:38 +01:00
Simon Kelley 353ae4d270 Check assumed SLAAC addresses by pinging them. 2012-03-19 20:07:51 +00:00
Simon Kelley ceae00dddf lease script should work with IPv6 now. 2012-02-09 21:28:14 +00:00
Simon Kelley 4cb1b32009 Clean compile, basic DHCPv6 functionality is there.
TODO
     hostname handling.
     update DHCP6 configs from dns
     parse domain=<domain>,<IPv6 range>
     pretty-print counted string options.
     DECLINE messages
     lease-script fro DHCPv6
2012-02-06 14:30:41 +00:00
Simon Kelley 52b92f4db8 It compiles and it allocates a lease! No renewals yet. 2012-01-22 16:05:15 +00:00
Simon Kelley 5954608577 Updated copyright notices. Happy new year! 2012-01-06 20:02:04 +00:00
Simon Kelley c72daea868 Accumulated 2.60 changes going into git 2012-01-05 21:33:27 +00:00
Simon Kelley 7de060b08d import of dnsmasq-2.58.tar.gz 2012-01-05 17:31:15 +00:00
Simon Kelley 28866e9567 import of dnsmasq-2.56.tar.gz 2012-01-05 17:31:15 +00:00