mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-06 15:51:41 +00:00
Compare commits
93
Commits
v2.61test7
...
v2.63rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
132255b5da | ||
|
|
c4c0488ac6 | ||
|
|
a2ce6fcc91 | ||
|
|
12090548d2 | ||
|
|
8223cb15e7 | ||
|
|
4ba9b38cc5 | ||
|
|
42243214b5 | ||
|
|
23245c0cb2 | ||
|
|
b271446f82 | ||
|
|
611ebc5f1e | ||
|
|
be0f45cdbc | ||
|
|
9b40cbf587 | ||
|
|
c4a7f90ebb | ||
|
|
9609baee41 | ||
|
|
395eb71931 | ||
|
|
8bc4cecee6 | ||
|
|
6b617c0d15 | ||
|
|
55d290a3bf | ||
|
|
e17b4b3871 | ||
|
|
236e072cab | ||
|
|
05ff1ed7cc | ||
|
|
2b5bae9a8f | ||
|
|
39f1b8e73d | ||
|
|
af576b56c2 | ||
|
|
54dd393f39 | ||
|
|
4ce4f3779b | ||
|
|
8b3ae2fd43 | ||
|
|
ed55cb66e6 | ||
|
|
2cd9a0de1f | ||
|
|
c514ab9907 | ||
|
|
078a630bba | ||
|
|
43c271b07c | ||
|
|
24ce681e51 | ||
|
|
5ae34bf3c8 | ||
|
|
51931b888a | ||
|
|
9f7f3b1216 | ||
|
|
97c83bb05b | ||
|
|
8767ceecd4 | ||
|
|
18c63eff8f | ||
|
|
c64b7f6a78 | ||
|
|
068b4b51e3 | ||
|
|
919dd7cf14 | ||
|
|
f632e56793 | ||
|
|
2021c66251 | ||
|
|
8358e0f4b2 | ||
|
|
7f61b3ad59 | ||
|
|
a9ab732e35 | ||
|
|
11263a462c | ||
|
|
231d061b45 | ||
|
|
cdbee9a40b | ||
|
|
7b4ad2eb34 | ||
|
|
19d69be220 | ||
|
|
04363607aa | ||
|
|
dcffad2a86 | ||
|
|
6a69ab5ebd | ||
|
|
fc92ead0dd | ||
|
|
61ce600b20 | ||
|
|
7a14dfebbb | ||
|
|
42fb8153ba | ||
|
|
6f13e53886 | ||
|
|
d1c759c5c1 | ||
|
|
e46164e0bd | ||
|
|
7389ce7ff5 | ||
|
|
2f77797b17 | ||
|
|
9380ba70d6 | ||
|
|
1023dcbc9e | ||
|
|
83e854e359 | ||
|
|
50303b19d8 | ||
|
|
89382bacaa | ||
|
|
6c559c34df | ||
|
|
adaa6888dd | ||
|
|
a813111379 | ||
|
|
18f0fb050b | ||
|
|
05e92e5afe | ||
|
|
4723d49dad | ||
|
|
fbbc14541a | ||
|
|
5ef33279f2 | ||
|
|
1e02a85970 | ||
|
|
0e88d53faa | ||
|
|
01d1b8ddf2 | ||
|
|
c8257540bc | ||
|
|
2240704863 | ||
|
|
e8ca69ea16 | ||
|
|
da632e7cc1 | ||
|
|
30cd96663f | ||
|
|
7dbe98147d | ||
|
|
5d71d83420 | ||
|
|
38a59a9ff7 | ||
|
|
4b028ad612 | ||
|
|
442560beb4 | ||
|
|
7d2b5c9583 | ||
|
|
29689cfa5a | ||
|
|
52d4abf2f9 |
No files matched your search
@@ -1,18 +1,89 @@
|
|||||||
|
version 2.63
|
||||||
|
Do duplicate dhcp-host address check in --test mode.
|
||||||
|
|
||||||
|
Check that tftp-root directories are accessible before
|
||||||
|
start-up. Thanks to Daniel Veillard for the initial patch.
|
||||||
|
|
||||||
|
Allow more than one --tfp-root flag. The per-interface
|
||||||
|
stuff is pointless without that.
|
||||||
|
|
||||||
|
Add --bind-dynamic. A hybrid mode between the default and
|
||||||
|
--bind-interfaces which copes with dynamically created
|
||||||
|
interfaces.
|
||||||
|
|
||||||
|
A couple of fixes to the build system for Android. Thanks
|
||||||
|
to Metin Kaya for the patches.
|
||||||
|
|
||||||
|
Remove the interface:<interface> argument in --dhcp-range, and
|
||||||
|
the interface argument to --enable-tftp. These were a
|
||||||
|
still-born attempt to allow automatic isolated
|
||||||
|
configuration by libvirt, but have never (to my knowledge)
|
||||||
|
been used, had very strange semantics, and have been
|
||||||
|
superceded by other mechanisms.
|
||||||
|
|
||||||
|
Fixed bug logging filenames when duplicate dhcp-host
|
||||||
|
addresses are found. Thanks to John Hanks for the patch.
|
||||||
|
|
||||||
|
Fix regression in 2.61 which broke caching of CNAME
|
||||||
|
chains. Thanks to Atul Gupta for the bug report.
|
||||||
|
|
||||||
|
Allow the target of a --cname flag to be another --cname.
|
||||||
|
|
||||||
|
Teach DHCPv6 about the RFC 4242 information-refresh-time
|
||||||
|
option, and add parsing if the minutes, hours and days
|
||||||
|
format for options. Thanks to Francois-Xavier Le Bail for
|
||||||
|
the suggestion.
|
||||||
|
|
||||||
|
Allow "w" (for week) as multiplier in lease times, as well
|
||||||
|
as seconds, minutes, hours and days. Álvaro Gámez Machado
|
||||||
|
spotted the ommission.
|
||||||
|
|
||||||
|
Update French translation. Thanks to Gildas Le Nadan.
|
||||||
|
|
||||||
|
|
||||||
|
version 2.62
|
||||||
|
Update German translation. Thanks to Conrad Kostecki.
|
||||||
|
|
||||||
|
Cope with router-solict packets wich don't have a valid
|
||||||
|
source address. Thanks to Vladislav Grishenko for the patch.
|
||||||
|
|
||||||
|
Fixed bug which caused missing periodic router
|
||||||
|
advertisements with some configurations. Thanks to
|
||||||
|
Vladislav Grishenko for the patch.
|
||||||
|
|
||||||
|
Fixed bug which broke DHCPv6/RA with prefix lengths
|
||||||
|
which are not divisible by 8. Thanks to Andre Coetzee
|
||||||
|
for spotting this.
|
||||||
|
|
||||||
|
Fix non-response to router-solicitations when
|
||||||
|
router-advertisement configured, but DHCPv6 not
|
||||||
|
configured. Thanks to Marien Zwart for the patch.
|
||||||
|
|
||||||
|
Add --dns-rr, to allow arbitrary DNS resource records.
|
||||||
|
|
||||||
|
Fixed bug which broke RA scheduling when an interface had
|
||||||
|
two addresses in the same network. Thanks to Jim Bos for
|
||||||
|
his help nailing this.
|
||||||
|
|
||||||
version 2.61
|
version 2.61
|
||||||
Re-write interface discovery code on *BSD to use
|
Re-write interface discovery code on *BSD to use
|
||||||
getifaddrs. This is more portable, more straightforward,
|
getifaddrs. This is more portable, more straightforward,
|
||||||
and allows us to find the prefix length for IPv6
|
and allows us to find the prefix length for IPv6
|
||||||
addresses.
|
addresses.
|
||||||
|
|
||||||
Add ra-names DHCPv6 keyword which adds AAAA records
|
Add ra-names, ra-stateless and slaac keywords for DHCPv6.
|
||||||
for dual-stack hosts which get IPv6 addresses via SLAAC.
|
Dnsmasq can now synthesise AAAA records for dual-stack
|
||||||
|
hosts which get IPv6 addresses via SLAAC. It is also now
|
||||||
|
possible to use SLAAC and stateless DHCPv6, and to
|
||||||
|
tell clients to use SLAAC addresses as well as DHCP ones.
|
||||||
|
Thanks to Dave Taht for help with this.
|
||||||
|
|
||||||
Add --dhcp-duid to allow DUID-EN uids to be used.
|
Add --dhcp-duid to allow DUID-EN uids to be used.
|
||||||
|
|
||||||
Explicity send DHCPv6 replies to the correct port, instead
|
Explicity send DHCPv6 replies to the correct port, instead
|
||||||
of relying on clients to send requests with the correct
|
of relying on clients to send requests with the correct
|
||||||
source address, since at least one client in the wild gets
|
source address, since at least one client in the wild gets
|
||||||
this wrong. Thanks to Conrda Kostecki for help tracking
|
this wrong. Thanks to Conrad Kostecki for help tracking
|
||||||
this down.
|
this down.
|
||||||
|
|
||||||
Send a preference value of 255 in DHCPv6 replies when
|
Send a preference value of 255 in DHCPv6 replies when
|
||||||
@@ -40,9 +111,67 @@ version 2.61
|
|||||||
|
|
||||||
Set the environment variable DNSMASQ_LOG_DHCP when running
|
Set the environment variable DNSMASQ_LOG_DHCP when running
|
||||||
the script id --log-dhcp is in effect, so that script can
|
the script id --log-dhcp is in effect, so that script can
|
||||||
taylor their logging verbosity. Suggestion from Malte Forkel.
|
taylor their logging verbosity. Suggestion from Malte
|
||||||
|
Forkel.
|
||||||
|
|
||||||
|
Arrange that addresses specified with --listen-address
|
||||||
|
work even if there is no interface carrying the
|
||||||
|
address. This is chiefly useful for IPv4 loopback
|
||||||
|
addresses, where any address in 127.0.0.0/8 is a valid
|
||||||
|
loopback address, but normally only 127.0.0.1 appears on
|
||||||
|
the lo interface. Thanks to Mathieu Trudel-Lapierre for
|
||||||
|
the idea and initial patch.
|
||||||
|
|
||||||
|
Fix crash, introduced in 2.60, when a DHCPINFORM is
|
||||||
|
received from a network which has no valid dhcp-range.
|
||||||
|
Thanks to Stephane Glondu for the bug report.
|
||||||
|
|
||||||
|
Add a new DHCP lease time keyword, "deprecated" for
|
||||||
|
--dhcp-range. This is only valid for IPv6, and sets the
|
||||||
|
preffered lease time for both DHCP and RA to zero. The
|
||||||
|
effect is that clients can continue to use the address
|
||||||
|
for existing connections, but new connections will use
|
||||||
|
other addresses, if they exist. This makes hitless
|
||||||
|
renumbering at least possible.
|
||||||
|
|
||||||
|
Fix bug in address6_available() which caused DHCPv6 lease
|
||||||
|
aquisition to fail if more than one dhcp-range in use.
|
||||||
|
|
||||||
|
Provide RDNSS and DNSSL data in router advertisements,
|
||||||
|
using the settings provided for DHCP options
|
||||||
|
option6:domain-search and option6:dns-server.
|
||||||
|
|
||||||
|
Tweak logo/favicon.ico to add some transparency. Thanks to
|
||||||
|
SamLT for work on this.
|
||||||
|
|
||||||
|
Don't cache data from non-recursive nameservers, since it
|
||||||
|
may erroneously look like a valid CNAME to a non-exitant
|
||||||
|
name. Thanks to Ben Winslow for finding this.
|
||||||
|
|
||||||
|
Call SO_BINDTODEVICE on the DHCP socket(s) when doing DHCP
|
||||||
|
on exactly one interface and --bind-interfaces is set. This
|
||||||
|
makes the OpenStack use-case of one dnsmasq per virtual
|
||||||
|
interface work. This is only available on Linux; it's not
|
||||||
|
supported on other platforms. Thanks to Vishvananda Ishaya
|
||||||
|
and the OpenStack team for the suggestion.
|
||||||
|
|
||||||
|
Updated French translation. Thanks to Gildas Le Nadan.
|
||||||
|
|
||||||
|
Give correct from-cache answers to explict CNAME queries.
|
||||||
|
Thanks to Rob Zwissler for spotting this.
|
||||||
|
|
||||||
|
Add --tftp-lowercase option. Thanks to Oliver Rath for the
|
||||||
|
patch.
|
||||||
|
|
||||||
|
Ensure that the DBus DhcpLeaseUpdated events are generated
|
||||||
|
when a lease goes through INIT_REBOOT state, even if the
|
||||||
|
dhcp-script is not in use. Thanks to Antoaneta-Ecaterina
|
||||||
|
Ene for the patch.
|
||||||
|
|
||||||
|
Fix failure of TFTP over IPv4 on OpenBSD platform. Thanks
|
||||||
|
to Brad Smith for spotting this.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
version 2.60
|
version 2.60
|
||||||
Fix compilation problem in Mac OS X Lion. Thanks to Olaf
|
Fix compilation problem in Mac OS X Lion. Thanks to Olaf
|
||||||
Flebbe for the patch.
|
Flebbe for the patch.
|
||||||
|
|||||||
@@ -236,53 +236,70 @@ Q: What network types are supported by the DHCP server?
|
|||||||
A: Ethernet (and 802.11 wireless) are supported on all platforms. On
|
A: Ethernet (and 802.11 wireless) are supported on all platforms. On
|
||||||
Linux all network types (including FireWire) are supported.
|
Linux all network types (including FireWire) are supported.
|
||||||
|
|
||||||
Q: What is this strange "bind-interface" option?
|
Q: What are these strange "bind-interface" and "bind-dynamic" options?
|
||||||
|
|
||||||
A: The DNS spec says that the reply to a DNS query must come from the
|
A: Dnsmasq from v2.63 can operate in one of three different "networking
|
||||||
same address it was sent to. The traditional way to write an UDP
|
modes". This is unfortunate as it requires users configuring dnsmasq
|
||||||
server to do this is to find all of the addresses belonging to the
|
to take into account some rather bizzare contraints and select the
|
||||||
machine (ie all the interfaces on the machine) and then create a
|
mode which best fits the requirements of a particular installation.
|
||||||
socket for each interface which is bound to the address of the
|
The origin of these are deficiencies in the Unix networking
|
||||||
interface. Then when a packet is sent to address A, it is received
|
model and APIs and each mode has different advantages and
|
||||||
on the socket bound to address A and when the reply is also sent
|
problems. Just to add to the confusion, not all modes are available on
|
||||||
via that socket, the source address is set to A by the kernel and
|
all platforms (due the to lack of supporting network APIs).To further
|
||||||
everything works. This is the how dnsmasq works when
|
add to the confusion, the rules for the DHCP subsystem on dnsmasq are
|
||||||
"bind-interfaces" is set, with the obvious extension that is misses
|
different to the rules for the DNS and TFTP subsystems.
|
||||||
out creating sockets for some interfaces depending on the
|
|
||||||
--interface, --address and --except-interface flags. The
|
|
||||||
disadvantage of this approach is that it breaks if interfaces don't
|
|
||||||
exist or are not configured when the daemon starts and does the
|
|
||||||
socket creation step. In a hotplug-aware world this is a real
|
|
||||||
problem.
|
|
||||||
|
|
||||||
The alternative approach is to have only one socket, which is bound
|
The three modes are "wildcard", "bind-interfaces" and "bind-dynamic".
|
||||||
to the correct port and the wildcard IP address (0.0.0.0). That
|
|
||||||
socket will receive _all_ packets sent to port 53, no matter what
|
|
||||||
destination address they have. This solves the problem of
|
|
||||||
interfaces which are created or reconfigured after daemon
|
|
||||||
start-up. To make this work is more complicated because of the
|
|
||||||
"reply source address" problem. When a UDP packet is sent by a
|
|
||||||
socket bound to 0.0.0.0 its source address will be set to the
|
|
||||||
address of one of the machine's interfaces, but which one is not
|
|
||||||
determined and can vary depending on the OS being run. To get round
|
|
||||||
this it is neccessary to use a scary advanced API to determine the
|
|
||||||
address to which a query was sent, and force that to be the source
|
|
||||||
address in the reply. For IPv4 this stuff in non-portable and quite
|
|
||||||
often not even available (It's different between FreeBSD 5.x and
|
|
||||||
Linux, for instance, and FreeBSD 4.x, Linux 2.0.x and OpenBSD don't
|
|
||||||
have it at all.) Hence "bind-interfaces" has to always be available
|
|
||||||
as a fall back. For IPv6 the API is standard and universally
|
|
||||||
available.
|
|
||||||
|
|
||||||
It could be argued that if the --interface or --address flags are
|
In "wildcard" mode, dnsmasq binds the wildcard IP address (0.0.0.0 or
|
||||||
used then binding interfaces is more appropriate, but using
|
::). This allows it to recieve all the packets sent to the server on
|
||||||
wildcard binding means that dnsmasq will quite happily start up
|
the relevant port. Access control (--interface, --except-interface,
|
||||||
after being told to use interfaces which don't exist, but which are
|
--listen-address, etc) is implemented by dnsmasq: it queries the
|
||||||
created later. Wildcard binding breaks the scenario when dnsmasq is
|
kernel to determine the interface on which a packet was recieved and
|
||||||
listening on one interface and another server (most probably BIND)
|
the address to which it was sent, and applies the configured
|
||||||
is listening on another. It's not possible for BIND to bind to an
|
rules. Wildcard mode is the default if neither of the other modes are
|
||||||
(address,port) pair when dnsmasq has bound (wildcard,port), hence
|
specified.
|
||||||
the ability to explicitly turn off wildcard binding.
|
|
||||||
|
In "bind-interfaces" mode, dnsmasq runs through all the network
|
||||||
|
interfaces available when it starts, finds the set of IP addresses on
|
||||||
|
those interfaces, filters that set using the access control
|
||||||
|
configuration, and then binds the set of IP addresses. Only packets
|
||||||
|
sent to the allowed addresses are delivered by the kernel to dnsmasq.
|
||||||
|
|
||||||
|
In "bind-dynamic" mode, access control filtering is done both by
|
||||||
|
binding individual IP addresses, as for bind-interfaces, and by
|
||||||
|
inspecting individual packets on arrival as for wildcard mode. In
|
||||||
|
addition, dnsmasq notices when new interfaces appear or new addresses
|
||||||
|
appear on existing interfaces, and the resulting IP addresses are
|
||||||
|
bound automatically without having to restart dnsmasq.
|
||||||
|
|
||||||
|
The mode chosen has four different effects: co-existence with other
|
||||||
|
servers, semantics of --interface access control, effect of new
|
||||||
|
interfaces, and legality of --interface specifications for
|
||||||
|
non-existent inferfaces. We will deal with these in order.
|
||||||
|
|
||||||
|
A dnsmasq instance running in wildcard mode precludes a machine from
|
||||||
|
running a second instance of dnsmasq or any other DNS, TFTP or DHCP
|
||||||
|
server. Attempts to do so will fail with an "address in use" error.
|
||||||
|
Dnsmasq running in --bind-interfaces or bind-dynamic mode allow other
|
||||||
|
instances of dnsmasq or other servers, as long as no two servers are
|
||||||
|
configured to listen on the same interface address.
|
||||||
|
|
||||||
|
The semantics of --interface varies subtly between wildcard or
|
||||||
|
bind-dynamic mode and bind-interfaces mode. The situation where this
|
||||||
|
matters is a request which arrives via one interface (A), but with a
|
||||||
|
destination address of a second interface (B) and when dnsmasq is
|
||||||
|
configured to listen only on B. In wildcard or bind-dynamic mode, such
|
||||||
|
a request will be ignored, in bind-interfaces mode, it will be
|
||||||
|
accepted.
|
||||||
|
|
||||||
|
The creation of new network interfaces after dnsmasq starts is ignored
|
||||||
|
by dnsmasq when in --bind-interfaces mode. In wildcard or bind-dynamic
|
||||||
|
mode, such interfaces are handled normally.
|
||||||
|
|
||||||
|
A --interface specification for a non-existent interface is a fatal
|
||||||
|
error at start-up when in --bind-interfaces mode, by just generates a
|
||||||
|
warning in wildcard or bind-dynamic mode.
|
||||||
|
|
||||||
Q: Why doesn't Kerberos work/why can't I get sensible answers to
|
Q: Why doesn't Kerberos work/why can't I get sensible answers to
|
||||||
queries for SRV records.
|
queries for SRV records.
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ LOCAL_C_INCLUDES := external/dnsmasq/src
|
|||||||
LOCAL_CFLAGS := -O2 -g -W -Wall -D__ANDROID__ -DNO_IPV6 -DNO_TFTP -DNO_SCRIPT
|
LOCAL_CFLAGS := -O2 -g -W -Wall -D__ANDROID__ -DNO_IPV6 -DNO_TFTP -DNO_SCRIPT
|
||||||
LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
|
LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
|
||||||
|
|
||||||
|
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
include $(BUILD_EXECUTABLE)
|
||||||
+1
-1
@@ -18,7 +18,7 @@ else
|
|||||||
vers=`cat $1/VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep $v[0-9]`
|
vers=`cat $1/VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep $v[0-9]`
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "${vers}" | head -n 1 | tail -c +2
|
echo "${vers}" | head -n 1 | sed 's/^v//'
|
||||||
else
|
else
|
||||||
cat $1/VERSION
|
cat $1/VERSION
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
To: dnsmasq-discuss@lists.thekelleys.org.uk
|
||||||
|
From: Alex Elsayed <eternaleye+usenet@gmail.com>
|
||||||
|
Date: Tue, 15 May 2012 01:53:54 -0700
|
||||||
|
Subject: [Dnsmasq-discuss] [PATCH] Support dbus activation
|
||||||
|
|
||||||
|
Introduce dbus service file and turn dbus on in the systemd
|
||||||
|
unit.
|
||||||
|
|
||||||
|
Note to packagers:
|
||||||
|
To add support for dbus activation, you must install the dbus
|
||||||
|
service file (dbus/uk.org.thekelleys.dnsmasq.service) into
|
||||||
|
$DATADIR/dbus-1/system-services.
|
||||||
|
|
||||||
|
---
|
||||||
|
contrib/systemd/dnsmasq.service | 2 +-
|
||||||
|
dbus/uk.org.thekelleys.dnsmasq.service | 7 +++++++
|
||||||
|
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
create mode 100644 dbus/uk.org.thekelleys.dnsmasq.service
|
||||||
|
|
||||||
|
diff --git a/contrib/systemd/dnsmasq.service
|
||||||
|
b/contrib/systemd/dnsmasq.service
|
||||||
|
index a27fe6d..4a784d3 100644
|
||||||
|
--- a/contrib/systemd/dnsmasq.service
|
||||||
|
+++ b/contrib/systemd/dnsmasq.service
|
||||||
|
@@ -5,7 +5,7 @@ Description=A lightweight DHCP and caching DNS server
|
||||||
|
Type=dbus
|
||||||
|
BusName=uk.org.thekelleys.dnsmasq
|
||||||
|
ExecStartPre=/usr/sbin/dnsmasq --test
|
||||||
|
-ExecStart=/usr/sbin/dnsmasq -k
|
||||||
|
+ExecStart=/usr/sbin/dnsmasq -k -1
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
diff --git a/dbus/uk.org.thekelleys.dnsmasq.service
|
||||||
|
b/dbus/uk.org.thekelleys.dnsmasq.service
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..f5fe98d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/dbus/uk.org.thekelleys.dnsmasq.service
|
||||||
|
@@ -0,0 +1,7 @@
|
||||||
|
+[D-BUS Service]
|
||||||
|
+Name=uk.org.thekelleys.dnsmasq
|
||||||
|
+Exec=/usr/sbin/dnsmasq -k -1
|
||||||
|
+User=root
|
||||||
|
+SystemdService=dnsmasq.service
|
||||||
|
+
|
||||||
|
+
|
||||||
|
--
|
||||||
|
1.7.10.2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_______________________________________________
|
||||||
|
Dnsmasq-discuss mailing list
|
||||||
|
Dnsmasq-discuss@lists.thekelleys.org.uk
|
||||||
|
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
|
||||||
|
|
||||||
Vendored
+35
-1
@@ -1,12 +1,46 @@
|
|||||||
|
dnsmasq (2.63-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream.
|
||||||
|
* Move /etc/dbus-1/system.d/dnsmasq.conf from dnsmasq to dnsmasq-base.
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Mon, 11 Jun 2012 21:55:35 +0000
|
||||||
|
|
||||||
|
dnsmasq (2.62-3) unstable; urgency=low
|
||||||
|
|
||||||
|
* Do resolvconf and /etc/default startup logic when
|
||||||
|
starting with systemd. (closes: #675854)
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Mon, 11 Jun 2012 21:50:11 +0000
|
||||||
|
|
||||||
|
dnsmasq (2.62-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Pass LDFLAGS to make to get hardening in linker.
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Thu, 7 Jun 2012 09:53:43 +0000
|
||||||
|
|
||||||
|
dnsmasq (2.62-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream.
|
||||||
|
* Use dpkg-buildflags. (Enables hardening).
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Sat, 12 May 2012 15:25:23 +0000
|
||||||
|
|
||||||
dnsmasq (2.61-1) unstable; urgency=low
|
dnsmasq (2.61-1) unstable; urgency=low
|
||||||
|
|
||||||
* New upstream.
|
* New upstream.
|
||||||
* Provide "dump-stats" initscript method. (closes: #654656)
|
* Provide "dump-stats" initscript method. (closes: #654656)
|
||||||
* Add (empty) build-indep and build-arch rules targets.
|
* Add (empty) build-indep and build-arch rules targets.
|
||||||
* Bump standards-version to 3.9.3
|
* Bump standards-version to 3.9.3
|
||||||
|
* Add port option to example dnsmasq.conf (closes: #668386)
|
||||||
|
|
||||||
-- Simon Kelley <simon@thekelleys.org.uk> Tue, 6 Mar 2012 19:45:43 +0000
|
-- Simon Kelley <simon@thekelleys.org.uk> Tue, 6 Mar 2012 19:45:43 +0000
|
||||||
|
|
||||||
|
dnsmasq (2.60-2) unstable; urgency=high
|
||||||
|
|
||||||
|
* Fix DHCPv4 segfault. (closes: #665008)
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Fri, 23 Mar 2012 09:37:23 +0000
|
||||||
|
|
||||||
dnsmasq (2.60-1) unstable; urgency=low
|
dnsmasq (2.60-1) unstable; urgency=low
|
||||||
|
|
||||||
* New upstream.
|
* New upstream.
|
||||||
|
|||||||
Vendored
-1
@@ -2,5 +2,4 @@
|
|||||||
/etc/default/dnsmasq
|
/etc/default/dnsmasq
|
||||||
/etc/dnsmasq.conf
|
/etc/dnsmasq.conf
|
||||||
/etc/resolvconf/update.d/dnsmasq
|
/etc/resolvconf/update.d/dnsmasq
|
||||||
/etc/dbus-1/system.d/dnsmasq.conf
|
|
||||||
/etc/insserv.conf.d/dnsmasq
|
/etc/insserv.conf.d/dnsmasq
|
||||||
Vendored
+2
-1
@@ -23,7 +23,8 @@ Description: Small caching DNS proxy and DHCP/TFTP server
|
|||||||
Package: dnsmasq-base
|
Package: dnsmasq-base
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}
|
Depends: ${shlibs:Depends}
|
||||||
Conflicts: dnsmasq (<<2.41)
|
Breaks: dnsmasq (<< 2.62-3)
|
||||||
|
Replaces: dnsmasq (<< 2.62-3)
|
||||||
Description: Small caching DNS proxy and DHCP/TFTP server
|
Description: Small caching DNS proxy and DHCP/TFTP server
|
||||||
This package contains the dnsmasq executable and documentation, but
|
This package contains the dnsmasq executable and documentation, but
|
||||||
not the infrastructure required to run it as a system daemon. For
|
not the infrastructure required to run it as a system daemon. For
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
/etc/dbus-1/system.d/dnsmasq.conf
|
||||||
Vendored
+21
@@ -259,6 +259,27 @@ case "$1" in
|
|||||||
dump-stats)
|
dump-stats)
|
||||||
kill -s USR1 `cat /var/run/dnsmasq/$NAME.pid`
|
kill -s USR1 `cat /var/run/dnsmasq/$NAME.pid`
|
||||||
;;
|
;;
|
||||||
|
systemd-start-resolvconf)
|
||||||
|
start_resolvconf
|
||||||
|
;;
|
||||||
|
systemd-stop-resolvconf)
|
||||||
|
stop_resolvconf
|
||||||
|
;;
|
||||||
|
systemd-exec)
|
||||||
|
# --pid-file without argument disables writing a PIDfile, we don't need one with sytemd.
|
||||||
|
# Enable DBus by default because we use DBus activation with systemd.
|
||||||
|
exec $DAEMON --keep-in-foreground --pid-file --enable-dbus \
|
||||||
|
${MAILHOSTNAME:+ -m $MAILHOSTNAME} \
|
||||||
|
${MAILTARGET:+ -t $MAILTARGET} \
|
||||||
|
${DNSMASQ_USER:+ -u $DNSMASQ_USER} \
|
||||||
|
${DNSMASQ_INTERFACES:+ $DNSMASQ_INTERFACES} \
|
||||||
|
${DHCP_LEASE:+ -l $DHCP_LEASE} \
|
||||||
|
${DOMAIN_SUFFIX:+ -s $DOMAIN_SUFFIX} \
|
||||||
|
${RESOLV_CONF:+ -r $RESOLV_CONF} \
|
||||||
|
${CACHESIZE:+ -c $CACHESIZE} \
|
||||||
|
${CONFIG_DIR:+ -7 $CONFIG_DIR} \
|
||||||
|
${DNSMASQ_OPTS:+ $DNSMASQ_OPTS}
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|dump-stats|status}" >&2
|
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|dump-stats|status}" >&2
|
||||||
exit 3
|
exit 3
|
||||||
|
|||||||
Vendored
+11
-10
@@ -11,14 +11,14 @@
|
|||||||
|
|
||||||
package=dnsmasq-base
|
package=dnsmasq-base
|
||||||
|
|
||||||
# policy manual, section 10.1
|
CFLAGS = $(shell export DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONS); dpkg-buildflags --get CFLAGS)
|
||||||
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
|
CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
|
||||||
CFLAGS = -g -O0 -Wall -W
|
CFLAGS += -Wall -W
|
||||||
else
|
|
||||||
CFLAGS = -g -O2 -Wall -W
|
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
|
||||||
endif
|
|
||||||
|
|
||||||
COPTS =
|
COPTS =
|
||||||
|
|
||||||
TARGET = install-i18n
|
TARGET = install-i18n
|
||||||
|
|
||||||
DEB_BUILD_ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
|
DEB_BUILD_ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
|
||||||
@@ -85,7 +85,6 @@ binary-indep: checkroot
|
|||||||
-d debian/daemon/etc/resolvconf/update.d \
|
-d debian/daemon/etc/resolvconf/update.d \
|
||||||
-d debian/daemon/usr/lib/resolvconf/dpkg-event.d \
|
-d debian/daemon/usr/lib/resolvconf/dpkg-event.d \
|
||||||
-d debian/daemon/etc/default \
|
-d debian/daemon/etc/default \
|
||||||
-d debian/daemon/etc/dbus-1/system.d \
|
|
||||||
-d debian/daemon/lib/systemd/system \
|
-d debian/daemon/lib/systemd/system \
|
||||||
-d debian/daemon/etc/insserv.conf.d
|
-d debian/daemon/etc/insserv.conf.d
|
||||||
install -m 644 debian/conffiles debian/daemon/DEBIAN
|
install -m 644 debian/conffiles debian/daemon/DEBIAN
|
||||||
@@ -96,7 +95,6 @@ binary-indep: checkroot
|
|||||||
install -m 644 debian/default debian/daemon/etc/default/dnsmasq
|
install -m 644 debian/default debian/daemon/etc/default/dnsmasq
|
||||||
install -m 644 dnsmasq.conf.example debian/daemon/etc/dnsmasq.conf
|
install -m 644 dnsmasq.conf.example debian/daemon/etc/dnsmasq.conf
|
||||||
install -m 644 debian/readme.dnsmasq.d debian/daemon/etc/dnsmasq.d/README
|
install -m 644 debian/readme.dnsmasq.d debian/daemon/etc/dnsmasq.d/README
|
||||||
install -m 644 debian/dbus.conf debian/daemon/etc/dbus-1/system.d/dnsmasq.conf
|
|
||||||
install -m 644 debian/systemd.service debian/daemon/lib/systemd/system/dnsmasq.service
|
install -m 644 debian/systemd.service debian/daemon/lib/systemd/system/dnsmasq.service
|
||||||
install -m 644 debian/insserv debian/daemon/etc/insserv.conf.d/dnsmasq
|
install -m 644 debian/insserv debian/daemon/etc/insserv.conf.d/dnsmasq
|
||||||
ln -s $(package) debian/daemon/usr/share/doc/dnsmasq
|
ln -s $(package) debian/daemon/usr/share/doc/dnsmasq
|
||||||
@@ -111,11 +109,12 @@ binary-arch: checkroot
|
|||||||
rm -rf debian/base
|
rm -rf debian/base
|
||||||
install -m 755 \
|
install -m 755 \
|
||||||
-d debian/base/DEBIAN \
|
-d debian/base/DEBIAN \
|
||||||
|
-d debian/base/etc/dbus-1/system.d \
|
||||||
-d debian/base/usr/share/doc/$(package) \
|
-d debian/base/usr/share/doc/$(package) \
|
||||||
-d debian/base/usr/share/doc/$(package)/examples \
|
-d debian/base/usr/share/doc/$(package)/examples \
|
||||||
-d debian/base/var/run \
|
-d debian/base/var/run \
|
||||||
-d debian/base/var/lib/misc
|
-d debian/base/var/lib/misc
|
||||||
make $(TARGET) PREFIX=/usr DESTDIR=`pwd`/debian/base CFLAGS="$(CFLAGS)" COPTS="$(COPTS)" CC=gcc
|
make $(TARGET) PREFIX=/usr DESTDIR=`pwd`/debian/base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(COPTS)" CC=gcc
|
||||||
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
||||||
install -m 644 doc.html debian/base/usr/share/doc/$(package)/.
|
install -m 644 doc.html debian/base/usr/share/doc/$(package)/.
|
||||||
install -m 644 setup.html debian/base/usr/share/doc/$(package)/.
|
install -m 644 setup.html debian/base/usr/share/doc/$(package)/.
|
||||||
@@ -129,10 +128,12 @@ ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
|||||||
install -m 644 dbus/DBus-interface debian/base/usr/share/doc/$(package)/.
|
install -m 644 dbus/DBus-interface debian/base/usr/share/doc/$(package)/.
|
||||||
gzip -9 debian/base/usr/share/doc/$(package)/DBus-interface
|
gzip -9 debian/base/usr/share/doc/$(package)/DBus-interface
|
||||||
endif
|
endif
|
||||||
|
install -m 644 debian/dnsmasq-base.conffiles debian/base/DEBIAN/conffiles
|
||||||
install -m 644 debian/changelog debian/base/usr/share/doc/$(package)/changelog.Debian
|
install -m 644 debian/changelog debian/base/usr/share/doc/$(package)/changelog.Debian
|
||||||
gzip -9 debian/base/usr/share/doc/$(package)/changelog.Debian
|
gzip -9 debian/base/usr/share/doc/$(package)/changelog.Debian
|
||||||
install -m 644 debian/readme debian/base/usr/share/doc/$(package)/README.Debian
|
install -m 644 debian/readme debian/base/usr/share/doc/$(package)/README.Debian
|
||||||
install -m 644 debian/copyright debian/base/usr/share/doc/$(package)/copyright
|
install -m 644 debian/copyright debian/base/usr/share/doc/$(package)/copyright
|
||||||
|
install -m 644 debian/dbus.conf debian/base/etc/dbus-1/system.d/dnsmasq.conf
|
||||||
gzip -9 debian/base/usr/share/man/man8/dnsmasq.8
|
gzip -9 debian/base/usr/share/man/man8/dnsmasq.8
|
||||||
for f in debian/base/usr/share/man/*; do \
|
for f in debian/base/usr/share/man/*; do \
|
||||||
if [ -f $$f/man8/dnsmasq.8 ]; then \
|
if [ -f $$f/man8/dnsmasq.8 ]; then \
|
||||||
@@ -155,7 +156,7 @@ ifeq ($(DEB_BUILD_ARCH_OS),linux)
|
|||||||
-d debian/utils/usr/share/man/man1 \
|
-d debian/utils/usr/share/man/man1 \
|
||||||
-d debian/utils/usr/bin \
|
-d debian/utils/usr/bin \
|
||||||
-d debian/utils/usr/share/doc/dnsmasq-utils
|
-d debian/utils/usr/share/doc/dnsmasq-utils
|
||||||
make -C contrib/wrt PREFIX=/usr DESTDIR=`pwd`/debian/utils CFLAGS="$(CFLAGS)" COPTS="$(COPTS)" CC=gcc
|
make -C contrib/wrt PREFIX=/usr DESTDIR=`pwd`/debian/utils CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(COPTS)" CC=gcc
|
||||||
install -m 755 contrib/wrt/dhcp_release debian/utils/usr/bin/dhcp_release
|
install -m 755 contrib/wrt/dhcp_release debian/utils/usr/bin/dhcp_release
|
||||||
install -m 644 contrib/wrt/dhcp_release.1 debian/utils/usr/share/man/man1/dhcp_release.1
|
install -m 644 contrib/wrt/dhcp_release.1 debian/utils/usr/share/man/man1/dhcp_release.1
|
||||||
gzip -9 debian/utils/usr/share/man/man1/dhcp_release.1
|
gzip -9 debian/utils/usr/share/man/man1/dhcp_release.1
|
||||||
|
|||||||
Vendored
+16
-14
@@ -8,22 +8,24 @@ BusName=uk.org.thekelleys.dnsmasq
|
|||||||
# Test the config file and refuse starting if it is not valid.
|
# Test the config file and refuse starting if it is not valid.
|
||||||
ExecStartPre=/usr/sbin/dnsmasq --test
|
ExecStartPre=/usr/sbin/dnsmasq --test
|
||||||
|
|
||||||
# Enable DBus by default because we use DBus activation.
|
# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
|
||||||
|
# wrapper picking up extra configuration files and then execs dnsmasq
|
||||||
|
# itself, when called with the "systemd-exec" function.
|
||||||
#
|
#
|
||||||
# Drop privileges and become the 'dnsmasq' user. It is recommended by dnsmasq
|
# It also adds the command-line flags
|
||||||
# upstream to run dnsmasq as an isolated user that does not run any other
|
# --keep-in-foreground --pid-file --enable-dbus
|
||||||
# processes, owns no files and has no shell. The default 'nobody' user has a
|
# to disable writing a pid-file (not needed with systemd) and
|
||||||
# shell and might be used for other processes.
|
# enable DBus by default because we use DBus activation.
|
||||||
#
|
#
|
||||||
# Debian-specific: add /etc/dnsmasq.d to config search path (with the exception
|
ExecStart=/etc/init.d/dnsmasq systemd-exec
|
||||||
# of .dpkg-*). Packages such as libvirt leave config files there.
|
|
||||||
#
|
# The systemd-*-resolvconf functions configure (and deconfigure)
|
||||||
# --pid-file without argument disables writing a PIDfile, we don't need one.
|
# resolvconf to work with the dnsmasq DNS server. They're called liek
|
||||||
ExecStart=/usr/sbin/dnsmasq -k \
|
# this to get correct error handling (ie don't start-resolvconf if the
|
||||||
--enable-dbus \
|
# dnsmasq daemon fails to start.
|
||||||
--user=dnsmasq \
|
ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
|
||||||
-7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new \
|
ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf
|
||||||
--pid-file
|
|
||||||
|
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
|
||||||
|
|||||||
+29
-3
@@ -4,6 +4,11 @@
|
|||||||
# as the long options legal on the command line. See
|
# as the long options legal on the command line. See
|
||||||
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
|
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
|
||||||
|
|
||||||
|
# Listen on this specific port instead of the standard DNS port
|
||||||
|
# (53). Setting this to zero completely disables DNS function,
|
||||||
|
# leaving only DHCP and/or TFTP.
|
||||||
|
#port=5353
|
||||||
|
|
||||||
# The following two options make you a better netizen, since they
|
# The following two options make you a better netizen, since they
|
||||||
# tell dnsmasq to filter out queries which the public DNS cannot
|
# tell dnsmasq to filter out queries which the public DNS cannot
|
||||||
# answer, and which load the servers (especially the root servers)
|
# answer, and which load the servers (especially the root servers)
|
||||||
@@ -169,14 +174,32 @@
|
|||||||
# hosts. Use the DHCPv4 lease to derive the name, network segment and
|
# hosts. Use the DHCPv4 lease to derive the name, network segment and
|
||||||
# MAC address and assume that the host will also have an
|
# MAC address and assume that the host will also have an
|
||||||
# IPv6 address calculated using the SLAAC alogrithm.
|
# IPv6 address calculated using the SLAAC alogrithm.
|
||||||
# This will generate an erroneous AAAA record if a host is using privacy
|
|
||||||
# extensions or does not support IPv6. Use with care.
|
|
||||||
#dhcp-range=1234::, ra-names
|
#dhcp-range=1234::, ra-names
|
||||||
|
|
||||||
# Do Router Advertisements, BUT NOT DHCP for this subnet.
|
# Do Router Advertisements, BUT NOT DHCP for this subnet.
|
||||||
# Set the lifetime to 46 hours. (Note: minimum lifetime is 2 hours.)
|
# Set the lifetime to 46 hours. (Note: minimum lifetime is 2 hours.)
|
||||||
#dhcp-range=1234::, ra-only, 48h
|
#dhcp-range=1234::, ra-only, 48h
|
||||||
|
|
||||||
|
# Do DHCP and Router Advertisements for this subnet. Set the A bit in the RA
|
||||||
|
# so that clients can use SLAAC addresses as well as DHCP ones.
|
||||||
|
#dhcp-range=1234::2, 1234::500, slaac
|
||||||
|
|
||||||
|
# Do Router Advertisements and stateless DHCP for this subnet. Clients will
|
||||||
|
# not get addresses from DHCP, but they will get other configuration information.
|
||||||
|
# They will use SLAAC for addresses.
|
||||||
|
#dhcp-range=1234::, ra-stateless
|
||||||
|
|
||||||
|
# Do stateless DHCP, SLAAC, and generate DNS names for SLAAC addresses
|
||||||
|
# from DHCPv4 leases.
|
||||||
|
#dhcp-range=1234::, ra-stateless, ra-names
|
||||||
|
|
||||||
|
# Do router advertisements for all subnets where we're doing DHCPv6
|
||||||
|
# Unless overriden by ra-stateless, ra-names, et al, the router
|
||||||
|
# advertisements will have the M and O bits set, so that the clients
|
||||||
|
# get addresses and configuration from DHCPv6, and the A bit reset, so the
|
||||||
|
# clients don't use SLAAC addresses.
|
||||||
|
#enable-ra
|
||||||
|
|
||||||
# Supply parameters for specified hosts using DHCP. There are lots
|
# Supply parameters for specified hosts using DHCP. There are lots
|
||||||
# of valid alternatives, so we will give examples of each. Note that
|
# of valid alternatives, so we will give examples of each. Note that
|
||||||
# IP addresses DO NOT have to be in the range given above, they just
|
# IP addresses DO NOT have to be in the range given above, they just
|
||||||
@@ -303,6 +326,9 @@
|
|||||||
# dnsmasq and another.
|
# dnsmasq and another.
|
||||||
#dhcp-option=option6:dns-server,[::],[1234::88]
|
#dhcp-option=option6:dns-server,[::],[1234::88]
|
||||||
|
|
||||||
|
# Ask client to poll for option changes every six hours. (RFC4242)
|
||||||
|
#dhcp-option=option6:information-refresh-time,6h
|
||||||
|
|
||||||
# Set the NTP time server address to be the same machine as
|
# Set the NTP time server address to be the same machine as
|
||||||
# is running dnsmasq
|
# is running dnsmasq
|
||||||
#dhcp-option=42,0.0.0.0
|
#dhcp-option=42,0.0.0.0
|
||||||
@@ -499,7 +525,7 @@
|
|||||||
# If you want to disable negative caching, uncomment this.
|
# If you want to disable negative caching, uncomment this.
|
||||||
#no-negcache
|
#no-negcache
|
||||||
|
|
||||||
# Normally responses which come form /etc/hosts and the DHCP lease
|
# Normally responses which come from /etc/hosts and the DHCP lease
|
||||||
# file have Time-To-Live set as zero, which conventionally means
|
# file have Time-To-Live set as zero, which conventionally means
|
||||||
# do not cache further. If you are happy to trade lower load on the
|
# do not cache further. If you are happy to trade lower load on the
|
||||||
# server for potentially stale date, you can set a time-to-live (in
|
# server for potentially stale date, you can set a time-to-live (in
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
+82
-88
@@ -23,7 +23,7 @@ options. It includes a secure, read-only,
|
|||||||
TFTP server to allow net/PXE boot of DHCP hosts and also supports BOOTP.
|
TFTP server to allow net/PXE boot of DHCP hosts and also supports BOOTP.
|
||||||
.PP
|
.PP
|
||||||
Dnsmasq
|
Dnsmasq
|
||||||
supports IPv6 for all functions and a minimal router-advertisemnet daemon.
|
supports IPv6 for all functions and a minimal router-advertisement daemon.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
Note that in general missing parameters are allowed and switch off
|
Note that in general missing parameters are allowed and switch off
|
||||||
functions, for instance "--pid-file" disables writing a PID file. On
|
functions, for instance "--pid-file" disables writing a PID file. On
|
||||||
@@ -204,6 +204,17 @@ running another nameserver (or another instance of dnsmasq) on the
|
|||||||
same machine. Setting this option also enables multiple instances of
|
same machine. Setting this option also enables multiple instances of
|
||||||
dnsmasq which provide DHCP service to run in the same machine.
|
dnsmasq which provide DHCP service to run in the same machine.
|
||||||
.TP
|
.TP
|
||||||
|
.B --bind-dynamic
|
||||||
|
Enable a network mode which is a hybrid between
|
||||||
|
.B --bind-interfaces
|
||||||
|
and the default. Dnsmasq binds the address of individual interfaces,
|
||||||
|
allowing multiple dnsmasq instances, but if new interfaces or
|
||||||
|
addresses appear, it automatically listens on those (subject to any
|
||||||
|
access-control configuration). This makes dynamically created
|
||||||
|
interfaces work in the same way as the default. Implementing this
|
||||||
|
option requires non-standard networking APIs and it is only available
|
||||||
|
under Linux. On other platforms it falls-back to --bind-interfaces mode.
|
||||||
|
.TP
|
||||||
.B \-y, --localise-queries
|
.B \-y, --localise-queries
|
||||||
Return answers to DNS queries from /etc/hosts which depend on the interface over which the query was
|
Return answers to DNS queries from /etc/hosts which depend on the interface over which the query was
|
||||||
received. If a name in /etc/hosts has more than one address associated with
|
received. If a name in /etc/hosts has more than one address associated with
|
||||||
@@ -416,7 +427,7 @@ zone files: the port, weight and priority numbers are in a different
|
|||||||
order. More than one SRV record for a given service/domain is allowed,
|
order. More than one SRV record for a given service/domain is allowed,
|
||||||
all that match are returned.
|
all that match are returned.
|
||||||
.TP
|
.TP
|
||||||
.B --host-record=<name>[,<name>....][<IPv4-address>],[IPv6-address]
|
.B --host-record=<name>[,<name>....][<IPv4-address>],[<IPv6-address>]
|
||||||
Add A, AAAA and PTR records to the DNS. This adds one or more names to
|
Add A, AAAA and PTR records to the DNS. This adds one or more names to
|
||||||
the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may
|
the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may
|
||||||
appear in more than one
|
appear in more than one
|
||||||
@@ -427,10 +438,12 @@ the same rule as is used reading hosts-files.
|
|||||||
.B host-record
|
.B host-record
|
||||||
options are considered to be read before host-files, so a name
|
options are considered to be read before host-files, so a name
|
||||||
appearing there inhibits PTR-record creation if it appears in
|
appearing there inhibits PTR-record creation if it appears in
|
||||||
hosts-file also. Unlike host-files, names are not expanded, even when
|
hosts-file also. Unlike hosts-files, names are not expanded, even when
|
||||||
.B expand-hosts
|
.B expand-hosts
|
||||||
is in effect. Short and long names may appear in the same
|
is in effect. Short and long names may appear in the same
|
||||||
.B host-record, eg. --host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100
|
.B host-record,
|
||||||
|
eg.
|
||||||
|
.B --host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100
|
||||||
.TP
|
.TP
|
||||||
.B \-Y, --txt-record=<name>[[,<text>],<text>]
|
.B \-Y, --txt-record=<name>[[,<text>],<text>]
|
||||||
Return a TXT DNS record. The value of TXT record is a set of strings,
|
Return a TXT DNS record. The value of TXT record is a set of strings,
|
||||||
@@ -448,10 +461,18 @@ Return an NAPTR DNS record, as specified in RFC3403.
|
|||||||
Return a CNAME record which indicates that <cname> is really
|
Return a CNAME record which indicates that <cname> is really
|
||||||
<target>. There are significant limitations on the target; it must be a
|
<target>. There are significant limitations on the target; it must be a
|
||||||
DNS name which is known to dnsmasq from /etc/hosts (or additional
|
DNS name which is known to dnsmasq from /etc/hosts (or additional
|
||||||
hosts files) or from DHCP. If the target does not satisfy this
|
hosts files), from DHCP or from another
|
||||||
|
.B --cname.
|
||||||
|
If the target does not satisfy this
|
||||||
criteria, the whole cname is ignored. The cname must be unique, but it
|
criteria, the whole cname is ignored. The cname must be unique, but it
|
||||||
is permissable to have more than one cname pointing to the same target.
|
is permissable to have more than one cname pointing to the same target.
|
||||||
.TP
|
.TP
|
||||||
|
.B --dns-rr=<name>,<RR-number>,[<hex data>]
|
||||||
|
Return an arbitrary DNS Resource Record. The number is the type of the
|
||||||
|
record (which is always in the C_IN class). The value of the record is
|
||||||
|
given by the hex data, which may be of the form 01:23:45 or 01 23 45 or
|
||||||
|
012345 or any mixture of these.
|
||||||
|
.TP
|
||||||
.B --interface-name=<name>,<interface>
|
.B --interface-name=<name>,<interface>
|
||||||
Return a DNS record associating the name with the primary address on
|
Return a DNS record associating the name with the primary address on
|
||||||
the given interface. This flag specifies an A record for the given
|
the given interface. This flag specifies an A record for the given
|
||||||
@@ -510,9 +531,9 @@ compiled in and the kernel must have conntrack support
|
|||||||
included and configured. This option cannot be combined with
|
included and configured. This option cannot be combined with
|
||||||
--query-port.
|
--query-port.
|
||||||
.TP
|
.TP
|
||||||
.B \-F, --dhcp-range=[interface:<interface>,][tag:<tag>[,tag:<tag>],][set:<tag],]<start-addr>,<end-addr>[,<netmask>[,<broadcast>]][,<lease time>]
|
.B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag],]<start-addr>[,<end-addr>][,<mode>][,<netmask>[,<broadcast>]][,<lease time>]
|
||||||
.TP
|
.TP
|
||||||
.B \-F, --dhcp-range=[interface:<interface>,][tag:<tag>[,tag:<tag>],][set:<tag],]<start-IPv6addr>,<end-IPv6addr>[,<prefix-len>][,<lease time>]
|
.B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag],]<start-IPv6addr>[,<end-IPv6addr>][,<mode>][,<prefix-len>][,<lease time>]
|
||||||
|
|
||||||
Enable the DHCP server. Addresses will be given out from the range
|
Enable the DHCP server. Addresses will be given out from the range
|
||||||
<start-addr> to <end-addr> and from statically defined addresses given
|
<start-addr> to <end-addr> and from statically defined addresses given
|
||||||
@@ -522,8 +543,12 @@ options. If the lease time is given, then leases
|
|||||||
will be given for that length of time. The lease time is in seconds,
|
will be given for that length of time. The lease time is in seconds,
|
||||||
or minutes (eg 45m) or hours (eg 1h) or "infinite". If not given,
|
or minutes (eg 45m) or hours (eg 1h) or "infinite". If not given,
|
||||||
the default lease time is one hour. The
|
the default lease time is one hour. The
|
||||||
minimum lease time is two minutes. This
|
minimum lease time is two minutes. For IPv6 ranges, the lease time
|
||||||
option may be repeated, with different addresses, to enable DHCP
|
maybe "deprecated"; this sets the preferred lifetime sent in a DHCP
|
||||||
|
lease or router advertisement to zero, which causes clients to use
|
||||||
|
other addresses, if available, for new connections as a prelude to renumbering.
|
||||||
|
|
||||||
|
This option may be repeated, with different addresses, to enable DHCP
|
||||||
service to more than one network. For directly connected networks (ie,
|
service to more than one network. For directly connected networks (ie,
|
||||||
networks on which the machine running dnsmasq has an interface) the
|
networks on which the machine running dnsmasq has an interface) the
|
||||||
netmask is optional: dnsmasq will determine it from the interface
|
netmask is optional: dnsmasq will determine it from the interface
|
||||||
@@ -548,7 +573,7 @@ When it is prefixed with 'tag:' instead, then its meaning changes from setting
|
|||||||
a tag to matching it. Only one tag may be set, but more than one tag
|
a tag to matching it. Only one tag may be set, but more than one tag
|
||||||
may be matched.
|
may be matched.
|
||||||
|
|
||||||
The end address may be replaced by the keyword
|
The optional <mode> keyword may be
|
||||||
.B static
|
.B static
|
||||||
which tells dnsmasq to enable DHCP for the network specified, but not
|
which tells dnsmasq to enable DHCP for the network specified, but not
|
||||||
to dynamically allocate IP addresses: only hosts which have static
|
to dynamically allocate IP addresses: only hosts which have static
|
||||||
@@ -556,37 +581,51 @@ addresses given via
|
|||||||
.B dhcp-host
|
.B dhcp-host
|
||||||
or from /etc/ethers will be served.
|
or from /etc/ethers will be served.
|
||||||
|
|
||||||
The end address may be replaced by
|
For IPv4, the <mode> may be
|
||||||
the keyword
|
|
||||||
.B proxy
|
.B proxy
|
||||||
in which case dnsmasq will provide proxy-DHCP on the specified
|
in which case dnsmasq will provide proxy-DHCP on the specified
|
||||||
subnet. (See
|
subnet. (See
|
||||||
.B pxe-prompt
|
.B pxe-prompt
|
||||||
and
|
and
|
||||||
.B pxe-service
|
.B pxe-service
|
||||||
for details, applies to IPv4 only.)
|
for details.)
|
||||||
|
|
||||||
|
For IPv6, the mode may be some combination of
|
||||||
|
.B ra-only, slaac, ra-names, ra-stateless.
|
||||||
|
|
||||||
The end address may be replaced by
|
|
||||||
the keyword
|
|
||||||
.B ra-only
|
.B ra-only
|
||||||
which tells dnsmasq to offer Router Advertisement only on this subnet,
|
tells dnsmasq to offer Router Advertisement only on this subnet,
|
||||||
and not DHCP. This applies to IPv6 only, see
|
and not DHCP.
|
||||||
.B enable-ra
|
|
||||||
for details. Instead, the keyword
|
.B slaac
|
||||||
|
tells dnsmasq to offer Router Advertisement on this subnet and to set
|
||||||
|
the A bit in the router advertisement, so that the client will use
|
||||||
|
SLAAC addresses. When used with a DHCP range or static DHCP address
|
||||||
|
this results in the client having both a DHCP-assigned and a SLAAC
|
||||||
|
address.
|
||||||
|
|
||||||
|
.B ra-stateless
|
||||||
|
sends router advertisements with the O and A bits set, and provides a
|
||||||
|
stateless DHCP service. The client will use a SLAAC address, and use
|
||||||
|
DHCP for other configuration information.
|
||||||
|
|
||||||
.B ra-names
|
.B ra-names
|
||||||
may be used. This does the same at ra-only, but also enables a mode
|
enables a mode
|
||||||
which gives DNS names to dual-stack hosts which do SLAAC for
|
which gives DNS names to dual-stack hosts which do SLAAC for
|
||||||
IPv6. Dnsmasq uses the host's IPv4 lease to derive the name, network
|
IPv6. Dnsmasq uses the host's IPv4 lease to derive the name, network
|
||||||
segment and MAC address and assumes that the host will also have an
|
segment and MAC address and assumes that the host will also have an
|
||||||
IPv6 address calculated using the SLAAC alogrithm, on the same network
|
IPv6 address calculated using the SLAAC algorithm, on the same network
|
||||||
segment. The address is pinged, and if a reply is received, an AAAA
|
segment. The address is pinged, and if a reply is received, an AAAA
|
||||||
record is added to the DNS for this IPv6
|
record is added to the DNS for this IPv6
|
||||||
address. Note that this is only happens for directly-connected
|
address. Note that this is only happens for directly-connected
|
||||||
networks, (not one doing DHCP via a relay) and it will not work
|
networks, (not one doing DHCP via a relay) and it will not work
|
||||||
if a host is using privacy extensions.
|
if a host is using privacy extensions.
|
||||||
|
.B ra-names
|
||||||
|
can be combined with
|
||||||
|
.B ra-stateless
|
||||||
|
and
|
||||||
|
.B slaac.
|
||||||
|
|
||||||
The interface:<interface name> section is not normally used. See the
|
|
||||||
NOTES section for details of this.
|
|
||||||
.TP
|
.TP
|
||||||
.B \-G, --dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]
|
.B \-G, --dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]
|
||||||
Specify per host parameters for the DHCP server. This allows a machine
|
Specify per host parameters for the DHCP server. This allows a machine
|
||||||
@@ -1120,7 +1159,9 @@ is known.
|
|||||||
DNSMASQ_TAGS contains all the tags set during the
|
DNSMASQ_TAGS contains all the tags set during the
|
||||||
DHCP transaction, separated by spaces.
|
DHCP transaction, separated by spaces.
|
||||||
|
|
||||||
DNSMASQ_LOG_DHCP is set if --log-dhcp is in effect.
|
DNSMASQ_LOG_DHCP is set if
|
||||||
|
.B --log-dhcp
|
||||||
|
is in effect.
|
||||||
|
|
||||||
For IPv4 only:
|
For IPv4 only:
|
||||||
|
|
||||||
@@ -1173,7 +1214,7 @@ with an "old " event.
|
|||||||
There are two further actions which may appear as the first argument
|
There are two further actions which may appear as the first argument
|
||||||
to the script, "init" and "tftp". More may be added in the future, so
|
to the script, "init" and "tftp". More may be added in the future, so
|
||||||
scripts should be written to ignore unknown actions. "init" is
|
scripts should be written to ignore unknown actions. "init" is
|
||||||
decsribed below in
|
described below in
|
||||||
.B --leasefile-ro
|
.B --leasefile-ro
|
||||||
The "tftp" action is invoked when a TFTP file transfer completes: the
|
The "tftp" action is invoked when a TFTP file transfer completes: the
|
||||||
arguments are the file size in bytes, the address to which the file
|
arguments are the file size in bytes, the address to which the file
|
||||||
@@ -1319,27 +1360,20 @@ only a subset of this is needed, and dnsmasq can handle it, using
|
|||||||
existing DHCP configuration to provide most data. When RA is enabled,
|
existing DHCP configuration to provide most data. When RA is enabled,
|
||||||
dnsmasq will advertise a prefix for each dhcp-range, with default
|
dnsmasq will advertise a prefix for each dhcp-range, with default
|
||||||
router and recursive DNS server as the relevant link-local address on
|
router and recursive DNS server as the relevant link-local address on
|
||||||
the machine running dnsmasq. The "managed address" bits are set, and
|
the machine running dnsmasq. By default, he "managed address" bits are set, and
|
||||||
the "use SLAAC" bit is reset, except for a dhcp-range which is
|
the "use SLAAC" bit is reset. This can be changed for individual
|
||||||
marked as "ra-only" or "ra-names", in which case RA is provided but no
|
subnets with the mode keywords described in
|
||||||
DHCPv6 service and the managed address bits are
|
.B --dhcp-range.
|
||||||
cleared and the "use SLAAC" bit set. If the same subnet appears in a
|
RFC6106 DNS parameters are included in the advertisements. By default,
|
||||||
normal dhcp-range and an "ra-only" dhcp-range, then the "managed
|
the relevant link-local address of the machine running dnsmasq is sent
|
||||||
address" bits and the "use SLAAC" bits are all set, allowing SLAAC and
|
as recursive DNS server. If provided, the DHCPv6 options dns-server and
|
||||||
DHCP address to co-exist on the same subnet.
|
domain-search are used for RDNSS and DNSSL.
|
||||||
.B enable-ra
|
|
||||||
enables router advertisement for prefixes where dnsmasq is doing
|
|
||||||
DHCPv6. It is not needed for "ra-only" prefixes. Creating an "ra-only"
|
|
||||||
prefix and not setting
|
|
||||||
.B enable-ra
|
|
||||||
sends advertisements only to "ra-only" prefixes.
|
|
||||||
.TP
|
.TP
|
||||||
.B --enable-tftp[=<interface>]
|
.B --enable-tftp
|
||||||
Enable the TFTP server function. This is deliberately limited to that
|
Enable the TFTP server function. This is deliberately limited to that
|
||||||
needed to net-boot a client. Only reading is allowed; the tsize and
|
needed to net-boot a client. Only reading is allowed; the tsize and
|
||||||
blksize extensions are supported (tsize is only supported in octet
|
blksize extensions are supported (tsize is only supported in octet
|
||||||
mode). See NOTES section for use of the interface argument.
|
mode).
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B --tftp-root=<directory>[,<interface>]
|
.B --tftp-root=<directory>[,<interface>]
|
||||||
Look for files to transfer using TFTP relative to the given
|
Look for files to transfer using TFTP relative to the given
|
||||||
@@ -1367,6 +1401,12 @@ are accessible. It is not recommended to run dnsmasq as root with TFTP
|
|||||||
enabled, and certainly not without specifying --tftp-root. Doing so
|
enabled, and certainly not without specifying --tftp-root. Doing so
|
||||||
can expose any world-readable file on the server to any host on the net.
|
can expose any world-readable file on the server to any host on the net.
|
||||||
.TP
|
.TP
|
||||||
|
.B --tftp-lowercase
|
||||||
|
Convert filenames in TFTP requests to all lowercase. This is useful
|
||||||
|
for requests from Windows machines, which have case-insensitive
|
||||||
|
filesystems and tend to play fast-and-loose with case in filenames.
|
||||||
|
Note that dnsmasq's tftp server always converts "\\" to "/" in filenames.
|
||||||
|
.TP
|
||||||
.B --tftp-max=<connections>
|
.B --tftp-max=<connections>
|
||||||
Set the maximum number of concurrent TFTP connections allowed. This
|
Set the maximum number of concurrent TFTP connections allowed. This
|
||||||
defaults to 50. When serving a large number of TFTP connections,
|
defaults to 50. When serving a large number of TFTP connections,
|
||||||
@@ -1597,52 +1637,6 @@ parameter in a BOOTP request is used as a tag,
|
|||||||
as is the tag "bootp", allowing some control over the options returned to
|
as is the tag "bootp", allowing some control over the options returned to
|
||||||
different classes of hosts.
|
different classes of hosts.
|
||||||
|
|
||||||
.B dhcp-range
|
|
||||||
may have an interface name supplied as
|
|
||||||
"interface:<interface-name>". The semantics if this are as follows:
|
|
||||||
For DHCP, if any other dhcp-range exists _without_ an interface name,
|
|
||||||
then the interface name is ignored and and dnsmasq behaves as if the
|
|
||||||
interface parts did not exist, otherwise DHCP is only provided to
|
|
||||||
interfaces mentioned in dhcp-range
|
|
||||||
declarations. For DNS, if there are no
|
|
||||||
.B --interface
|
|
||||||
or
|
|
||||||
.B --listen-address
|
|
||||||
flags, behaviour is unchanged by the interface part. If either of
|
|
||||||
these flags are present, the interfaces mentioned in
|
|
||||||
dhcp-ranges are added to the set which get DNS service.
|
|
||||||
|
|
||||||
Similarly,
|
|
||||||
.B enable-tftp
|
|
||||||
may take an interface name, which enables TFTP only for a particular
|
|
||||||
interface, ignoring
|
|
||||||
.B --interface
|
|
||||||
or
|
|
||||||
.B --listen-address
|
|
||||||
flags. In addition
|
|
||||||
.B --tftp-secure
|
|
||||||
and
|
|
||||||
.B --tftp-unique-root
|
|
||||||
and
|
|
||||||
.B --tftp-no-blocksize
|
|
||||||
are ignored for requests from such interfaces. (A
|
|
||||||
.B --tftp-root
|
|
||||||
directive giving a root path and an interface should be
|
|
||||||
provided too.)
|
|
||||||
|
|
||||||
These rules may seem odd at first sight, but they
|
|
||||||
allow a single line of the form "dhcp-range=interface:virt0,192.168.0.4,192.168.0.200"
|
|
||||||
to be added to dnsmasq configuration which then supplies
|
|
||||||
DHCP and DNS services to that interface, without affecting
|
|
||||||
what services are supplied to other interfaces and irrespective of
|
|
||||||
the existance or lack of "interface=<interface>"
|
|
||||||
lines elsewhere in the dnsmasq configuration.
|
|
||||||
"enable-tftp=virt0" and "tftp-root=<root>,virt0" do the same job for TFTP.
|
|
||||||
The idea is
|
|
||||||
that such a line can be added automatically by libvirt
|
|
||||||
or equivalent systems, without disturbing any manual
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
.SH EXIT CODES
|
.SH EXIT CODES
|
||||||
.PP
|
.PP
|
||||||
0 - Dnsmasq successfully forked into the background, or terminated
|
0 - Dnsmasq successfully forked into the background, or terminated
|
||||||
|
|||||||
+155
-75
@@ -22,7 +22,8 @@ peut être configuré pour envoyer n'importe quel option DHCP.
|
|||||||
Il inclut un serveur TFTP sécurisé en lecture seule permettant le démarrage via
|
Il inclut un serveur TFTP sécurisé en lecture seule permettant le démarrage via
|
||||||
le réseau/PXE de clients DHCP et supporte également le protocole BOOTP.
|
le réseau/PXE de clients DHCP et supporte également le protocole BOOTP.
|
||||||
.PP
|
.PP
|
||||||
Dnsmasq supporte IPv6 pour le DNS et TFTP mais pas pour le DHCP.
|
Dnsmasq supporte IPv6 et contient un démon minimaliste capable de faire des
|
||||||
|
annonces routeurs ("router-advertisements").
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
Notes : Il est possible d'utiliser des options sans leur donner de paramètre.
|
Notes : Il est possible d'utiliser des options sans leur donner de paramètre.
|
||||||
Dans ce cas, la fonction correspondante sera désactivée. Par exemple
|
Dans ce cas, la fonction correspondante sera désactivée. Par exemple
|
||||||
@@ -231,6 +232,18 @@ autre serveur de nom (ou une autre instance de Dnsmasq) tourne sur la même
|
|||||||
machine. Utiliser cette option permet également d'avoir plusieurs instances de
|
machine. Utiliser cette option permet également d'avoir plusieurs instances de
|
||||||
Dnsmasq fournissant un service DHCP sur la même machine.
|
Dnsmasq fournissant un service DHCP sur la même machine.
|
||||||
.TP
|
.TP
|
||||||
|
.B --bind-dynamic
|
||||||
|
Autorise un mode réseau intermédiaire entre
|
||||||
|
.B --bind-interfaces
|
||||||
|
et le mode par défaut. Dnsmasq s'associe à une seule interface, ce qui permet
|
||||||
|
plusieurs instances de dnsmasq, mais si une interface ou adresse apparaissent,
|
||||||
|
il se mettra automatiquement à écouter sur celles-ci (les règles de contrôle
|
||||||
|
d'accès s'appliquent).
|
||||||
|
De fait, les interfaces créées dynamiquement fonctionnent de la même façon que
|
||||||
|
dans le comportement par défaut. Ce fonctionnement nécessite des APIs réseau
|
||||||
|
non standard et n'est disponible que sous Linux. Sur les autres plateformes,
|
||||||
|
le fonctionnement est celui du mode --bind-interfaces.
|
||||||
|
.TP
|
||||||
.B \-y, --localise-queries
|
.B \-y, --localise-queries
|
||||||
Retourne des réponses aux requêtes DNS dépendantes de l'interface sur laquelle
|
Retourne des réponses aux requêtes DNS dépendantes de l'interface sur laquelle
|
||||||
la requête a été reçue, à partir du fichier /etc/hosts. Si un nom dans
|
la requête a été reçue, à partir du fichier /etc/hosts. Si un nom dans
|
||||||
@@ -492,6 +505,27 @@ dans un ordre différents. Pour un service/domaine donné, plus d'un
|
|||||||
enregistrement SRV est autorisé et tous les enregistrements qui coïncident sont
|
enregistrement SRV est autorisé et tous les enregistrements qui coïncident sont
|
||||||
retournés dans la réponse.
|
retournés dans la réponse.
|
||||||
.TP
|
.TP
|
||||||
|
.B --host-record=<nom>[,<nom>....][<adresse IPv4>],[<adresse IPv6>]
|
||||||
|
Ajoute des enregistrements A, AAAA et PTR dans le DNS. Ceci permet d'ajouter
|
||||||
|
un ou plusieurs noms dans le DNS et de les associer à des enregistrements IPv4
|
||||||
|
(A) ou IPv6 (AAAA). Un nom peut apparaître dans plus d'une entrée
|
||||||
|
.B host-record
|
||||||
|
et de fait être associé à plus d'une adresse. Seule la première entrée créée
|
||||||
|
l'enregistrement PTR associée au nom. Ceci correspond à la même règle que celle
|
||||||
|
utilisée lors de la lecture du fichier hosts.
|
||||||
|
Les options
|
||||||
|
.B host-record
|
||||||
|
sont considérées lues avant le fichier hosts, ainsi un nom apparaissant dans
|
||||||
|
une option host-record et dans le fichier hosts n'aura pas d'enregistrement
|
||||||
|
PTR associé à l'entrée dans le fichier hosts. A l'inverse du fichier hosts, les
|
||||||
|
noms ne sont pas étendus, même lorsque l'option
|
||||||
|
.B expand-hosts
|
||||||
|
est activée. Les noms longs et les noms courts peuvent apparaitre dans la même
|
||||||
|
entrée
|
||||||
|
.B host-record,
|
||||||
|
c-à-d
|
||||||
|
.B --host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100
|
||||||
|
.TP
|
||||||
.B \-Y, --txt-record=<nom>[[,<texte>],<texte>]
|
.B \-Y, --txt-record=<nom>[[,<texte>],<texte>]
|
||||||
Définit un enregistrement DNS de type TXT. La valeur de l'enregistrement TXT est
|
Définit un enregistrement DNS de type TXT. La valeur de l'enregistrement TXT est
|
||||||
un ensemble de chaînes de caractères, donc un nombre variable de chaînes de
|
un ensemble de chaînes de caractères, donc un nombre variable de chaînes de
|
||||||
@@ -510,9 +544,17 @@ Retourne un enregistrement de type NAPTR, tel que spécifié dans le RFC3403.
|
|||||||
Retourne un enregistrement de type CNAME qui indique que <cname> est en
|
Retourne un enregistrement de type CNAME qui indique que <cname> est en
|
||||||
réalité <cible>. Il existe des contraintes significatives sur la valeur
|
réalité <cible>. Il existe des contraintes significatives sur la valeur
|
||||||
de cible; il doit s'agir d'un nom DNS qui est connu de dnsmasq via /etc/hosts
|
de cible; il doit s'agir d'un nom DNS qui est connu de dnsmasq via /etc/hosts
|
||||||
(ou un fichier hôtes additionnel) ou via DHCP. Si une cible ne satisfait
|
(ou un fichier hôtes additionnel), ou via DHCP, ou par un autre
|
||||||
pas ces critères, le CNAME est ignoré. Le CNAME doit être unique, mais
|
.B --cname.
|
||||||
il est autorisé d'avoir plus d'un CNAME pointant vers la même cible.
|
Si une cible ne satisfait pas ces critères, le CNAME est ignoré. Le CNAME
|
||||||
|
doit être unique, mais il est autorisé d'avoir plus d'un CNAME pointant
|
||||||
|
vers la même cible.
|
||||||
|
.TP
|
||||||
|
.B --dns-rr=<nom>,<numéro-RR>,[<données hexadécimales>]
|
||||||
|
Retourne un enregistrement DNS arbitraire. Le numéro correspond au type
|
||||||
|
d'enregistrement (qui est toujours de la classe C_IN). La valeur de
|
||||||
|
l'enregistrement est donnée dans les données hexadécimales, qui peuvent
|
||||||
|
être de la forme 01:23:45, 01 23 45,+012345 ou n'importe quelle combinaison.
|
||||||
.TP
|
.TP
|
||||||
.B --interface-name=<nom>,<interface>
|
.B --interface-name=<nom>,<interface>
|
||||||
Définit un entregistrement DNS associant le nom avec l'adresse primaire sur
|
Définit un entregistrement DNS associant le nom avec l'adresse primaire sur
|
||||||
@@ -577,11 +619,11 @@ l'ayant déclenché, ce qui est pratique pour la gestion de la bande passante
|
|||||||
(accounting) et le filtrage (firewall). Dnsmasq doit pour cela être compilé
|
(accounting) et le filtrage (firewall). Dnsmasq doit pour cela être compilé
|
||||||
avec le support conntrack, le noyau doit également inclure conntrack et être
|
avec le support conntrack, le noyau doit également inclure conntrack et être
|
||||||
configuré pour cela. Cette option ne peut pas être combinée avec
|
configuré pour cela. Cette option ne peut pas être combinée avec
|
||||||
--query-port.
|
--query-port.
|
||||||
.TP
|
.TP
|
||||||
.B \-F, --dhcp-range=[interface:<interface>,][tag:<label>[,tag:<label>],][set:<label>],]<adresse de début>,<adresse de fin>[,<masque de réseau>[,<broadcast>]][,<durée de bail>]
|
.B \-F, --dhcp-range=[tag:<label>[,tag:<label>],][set:<label>],]<adresse de début>[,<adresse de fin>][,<mode>][,<masque de réseau>[,<broadcast>]][,<durée de bail>]
|
||||||
.TP
|
.TP
|
||||||
.B \-F, --dhcp-range=[interface:<interface>,][tag:<label>[,tag:<label>],][set:<label>],]<addresse IPv6 de début>,<adresse IPv6 de fin>[,<longueur de préfixe>][,<durée de bail>]
|
.B \-F, --dhcp-range=[tag:<label>[,tag:<label>],][set:<label>],]<addresse IPv6 de début>[,<adresse IPv6 de fin>][,<mode>][,<longueur de préfixe>][,<durée de bail>]
|
||||||
Active le serveur DHCP. Les adresses seront données dans la plage comprise entre
|
Active le serveur DHCP. Les adresses seront données dans la plage comprise entre
|
||||||
<adresse de début> et <adresse de fin> et à partir des adresses définies
|
<adresse de début> et <adresse de fin> et à partir des adresses définies
|
||||||
statiquement dans l'option
|
statiquement dans l'option
|
||||||
@@ -592,6 +634,13 @@ en heures (exemple : 1h) ou être la chaine de caractère "infinite" pour une
|
|||||||
durée indéterminée. Si aucune valeur n'est donnée, une durée de bail par défaut
|
durée indéterminée. Si aucune valeur n'est donnée, une durée de bail par défaut
|
||||||
de une heure est appliquée. La valeur minimum pour un bail DHCP est de 2
|
de une heure est appliquée. La valeur minimum pour un bail DHCP est de 2
|
||||||
minutes.
|
minutes.
|
||||||
|
|
||||||
|
Pour les plages IPv6, la durée de bail peut-être égale au mot-clef "deprecated"
|
||||||
|
(obsolète); Cela positionne la durée de vie préférée envoyée dans les baux DHCP
|
||||||
|
ou les annonces routeurs à zéro, ce qui incite les clients à utiliser d'autres
|
||||||
|
adresses autant que possible, pour toute nouvelle connexion, en préalable à
|
||||||
|
la renumérotation.
|
||||||
|
|
||||||
Cette option peut être répétée, avec différentes adresses,
|
Cette option peut être répétée, avec différentes adresses,
|
||||||
pour activer le service DHCP sur plus d'un réseau. Pour des réseaux directement
|
pour activer le service DHCP sur plus d'un réseau. Pour des réseaux directement
|
||||||
connectés (c'est-à-dire des réseaux dans lesquels la machine sur laquelle tourne
|
connectés (c'est-à-dire des réseaux dans lesquels la machine sur laquelle tourne
|
||||||
@@ -622,33 +671,60 @@ Lorsque préfixé par 'tag:', la signification change, et au lieu de définir un
|
|||||||
label, il définit le label pour laquelle la règle s'applique. Un seul label peut-
|
label, il définit le label pour laquelle la règle s'applique. Un seul label peut-
|
||||||
être défini mais plusieurs labels peuvent coïncider.
|
être défini mais plusieurs labels peuvent coïncider.
|
||||||
|
|
||||||
L'adresse de fin peut être remplacée par le mot-clef
|
Le mot clef optionnel <mode> peut être égal à
|
||||||
.B static
|
.B static
|
||||||
("statique") qui indique à Dnsmasq d'activer le service DHCP pour le réseau
|
("statique") ce qui indique à Dnsmasq d'activer le service DHCP pour le réseau
|
||||||
spécifié, mais de ne pas activer l'allocation dynamique d'adresses IP : Seuls
|
spécifié, mais de ne pas activer l'allocation dynamique d'adresses IP : Seuls
|
||||||
les hôtes possédant des adresses IP statiques fournies via
|
les hôtes possédant des adresses IP statiques fournies via
|
||||||
.B dhcp-host
|
.B dhcp-host
|
||||||
ou présentes dans le fichier /etc/ethers seront alors servis par le DHCP.
|
ou présentes dans le fichier /etc/ethers seront alors servis par le DHCP.
|
||||||
|
|
||||||
L'adresse de fin peut-être remplacée par le mot-clef
|
Pour IPv4, le <mode> peut est égal à
|
||||||
.B proxy
|
.B proxy
|
||||||
, auquel cas Dnsmasq fournira un service de DHCP proxy pour le sous-réseau
|
, auquel cas Dnsmasq fournira un service de DHCP proxy pour le sous-réseau
|
||||||
spécifié. (voir
|
spécifié. (voir
|
||||||
.B pxe-prompt
|
.B pxe-prompt
|
||||||
et
|
et
|
||||||
.B pxe-service
|
.B pxe-service
|
||||||
pour plus de détails, s'applique à IPv4 seulement).
|
pour plus de détails).
|
||||||
|
|
||||||
|
Pour IPv6, le mode peut-être une combinaison des valeurs
|
||||||
|
.B ra-only, slaac, ra-names, ra-stateless.
|
||||||
|
|
||||||
L'adresse de fin peut être remplacée par le mot-clef
|
|
||||||
.B ra-only
|
.B ra-only
|
||||||
qui indique à dnsmasq de n'effectuer que des annonces de routeur (Router
|
indique à dnsmasq de n'effectuer que des annonces de routeur (Router
|
||||||
Advertisement, RA) sur ce sous-réseau, et de ne pas faire de DHCP. Ceci
|
Advertisement, RA) sur ce sous-réseau, et de ne pas faire de DHCP.
|
||||||
s'applique uniquement à IPv6, voir
|
|
||||||
.B enable-ra
|
.B slaac
|
||||||
pour plus de détails.
|
indique à dnsmasq d'effectuer des annonces de routeur sur ce sous-réseau
|
||||||
|
et de positionner dans celles-ci le bit A, afin que les clients utilisent
|
||||||
|
des adresses SLAAC. Lorsqu'utilisé conjointement avec une plage DHCP ou des
|
||||||
|
affectations statiques d'adresses DHCP, les clients disposeront à la fois
|
||||||
|
d'adresses DHCP assignées et d'adresses SLAAC.
|
||||||
|
|
||||||
|
.B ra-stateless
|
||||||
|
indique à dnsmasq d'effectuer des annonces de routeur avec les bits 0 et A
|
||||||
|
positionnés, et de fournir un service DHCP sans état ("stateless"). Les clients
|
||||||
|
utiliseront des adresses SLAAC, et utiliseront DHCP pour toutes les autres
|
||||||
|
informations de configuration.
|
||||||
|
|
||||||
|
.B ra-names
|
||||||
|
active un mode qui fourni des noms DNS aux hôtes fonctionnant en double pile
|
||||||
|
("dual stack") et configurés pour faire du SLAAC en IPv6. Dnsmasq utilise le
|
||||||
|
bail IPv4 de l'hôte afin de dériver le nom, le segment de réseau et l'adresse
|
||||||
|
MAC et assume que l'hôte disposera d'une adresse IPv6 calculée via l'algorithme
|
||||||
|
SLAAC, sur le même segment de réseau. Un ping est envoyé à l'adresse, et si une
|
||||||
|
réponse est obtenue, un enregistrement AAAA est rajouté dans le DNS pour cette
|
||||||
|
adresse IPv6. Veuillez-noter que cela n'arrive que pour les réseaux directement
|
||||||
|
connectés (et non ceux pour lesquels DHCP se fait via relai), et ne
|
||||||
|
fonctionnera pas si un hôte utilise les "extensions de vie privée"
|
||||||
|
("privacy extensions").
|
||||||
|
.B ra-names
|
||||||
|
peut-être combiné avec
|
||||||
|
.B ra-stateless
|
||||||
|
et
|
||||||
|
.B slaac.
|
||||||
|
|
||||||
La section interface:<nom d'interface> n'est normalement pas utilisée. Se
|
|
||||||
référer aux indications de la section NOTES pour plus de détail à ce sujet.
|
|
||||||
.TP
|
.TP
|
||||||
.B \-G, --dhcp-host=[<adresse matérielle>][,id:<identifiant client>|*][,set:<label>][,<adresse IP>][,<nom d'hôte>][,<durée de bail>][,ignore]
|
.B \-G, --dhcp-host=[<adresse matérielle>][,id:<identifiant client>|*][,set:<label>][,<adresse IP>][,<nom d'hôte>][,<durée de bail>][,ignore]
|
||||||
Spécifie les paramètres DHCP relatifs à un hôte. Cela permet à une machine
|
Spécifie les paramètres DHCP relatifs à un hôte. Cela permet à une machine
|
||||||
@@ -1170,9 +1246,21 @@ détermination de celles-ci.
|
|||||||
.B \-l, --dhcp-leasefile=<chemin de fichier>
|
.B \-l, --dhcp-leasefile=<chemin de fichier>
|
||||||
Utilise le fichier dont le chemin est fourni pour stocker les informations de
|
Utilise le fichier dont le chemin est fourni pour stocker les informations de
|
||||||
baux DHCP.
|
baux DHCP.
|
||||||
.TP
|
.TP
|
||||||
|
.B --dhcp-duid=<ID d'entreprise>,<uid>
|
||||||
|
(IPv6 seulement) Spécifie le numéro d'UID de serveur persistant que le serveur
|
||||||
|
DHCPv6 doit utiliser. Cette option n'est normalement pas requise, Dnsmasq
|
||||||
|
créant un DUID automatiquement lorsque cela est nécessaire. Lorsque cette
|
||||||
|
option est positionnée, elle fournit à Dnsmasq les données nécessaires à la
|
||||||
|
création d'un DUID de type DUID-EN. Veuillez noter qu'une fois créé, le DUID
|
||||||
|
est stocké dans la base des baux, aussi changer entre un DUID créé
|
||||||
|
automatiquement et un DUID-EN et vice-versa impose de réinitialiser la base de
|
||||||
|
baux. Le numéro d'ID d'entreprise est assigné par l'IANA, et l'uid est une
|
||||||
|
chaine hexadécimale unique à chaque serveur.
|
||||||
|
.TP
|
||||||
.B \-6 --dhcp-script=<chemin de fichier>
|
.B \-6 --dhcp-script=<chemin de fichier>
|
||||||
Lorsqu'un bail DHCP est créé, ou qu'un ancien est supprimé, le fichier dont le
|
Lorsqu'un bail DHCP est créé, qu'un ancien est supprimé, ou qu'un transfert
|
||||||
|
TFTP est terminé, le fichier dont le
|
||||||
chemin est spécifié est exécuté. Le <chemin de fichier> doit être un chemin
|
chemin est spécifié est exécuté. Le <chemin de fichier> doit être un chemin
|
||||||
absolu, aucune recherche n'est effectuée via la variable d'environnement PATH.
|
absolu, aucune recherche n'est effectuée via la variable d'environnement PATH.
|
||||||
Les arguments fournis à celui-ci sont soit
|
Les arguments fournis à celui-ci sont soit
|
||||||
@@ -1223,6 +1311,10 @@ relai DHCP pour contacter Dnsmasq, si l'adresse IP du relai est connue.
|
|||||||
DNSMASQ_TAGS contient tous les labels fournis pendant la transaction DHCP,
|
DNSMASQ_TAGS contient tous les labels fournis pendant la transaction DHCP,
|
||||||
séparés par des espaces.
|
séparés par des espaces.
|
||||||
|
|
||||||
|
DNSMASQ_LOG_DHCP est positionné si
|
||||||
|
.B --log-dhcp
|
||||||
|
est activé.
|
||||||
|
|
||||||
Pour IPv4 seulement :
|
Pour IPv4 seulement :
|
||||||
|
|
||||||
DNSMASQ_CLIENT_ID, si l'hôte a fourni un identifiant de client.
|
DNSMASQ_CLIENT_ID, si l'hôte a fourni un identifiant de client.
|
||||||
@@ -1262,6 +1354,16 @@ Au démarrage de Dnsmasq, le script sera invoqué pour chacun des baux existants
|
|||||||
dans le fichier des baux. Le script sera lancé avec l'action "del" pour les
|
dans le fichier des baux. Le script sera lancé avec l'action "del" pour les
|
||||||
baux expirés, et "old" pour les autres. Lorsque Dnsmasq reçoit un signal HUP,
|
baux expirés, et "old" pour les autres. Lorsque Dnsmasq reçoit un signal HUP,
|
||||||
le script sera invoqué avec une action "old" pour tous les baux existants.
|
le script sera invoqué avec une action "old" pour tous les baux existants.
|
||||||
|
|
||||||
|
Il existe deux autres actions pouvant apparaître comme argument au script :
|
||||||
|
"init" et "tftp". D'autres sont susceptibles d'être rajoutées dans le futur,
|
||||||
|
aussi les scripts devraient-être écrits de sorte à ignorer les actions
|
||||||
|
inconnues. "init" est décrite ci-dessous dans
|
||||||
|
.B --leasefile-ro.
|
||||||
|
L'action "tftp" est invoquée lorsqu'un transfert de fichier TFTP s'est
|
||||||
|
terminé. Ses arguments sont la taille du fichier en octets, l'adresse à
|
||||||
|
laquelle le fichier a été envoyé, ainsi que le chemin complet du fichier.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B --dhcp-luascript=<chemin>
|
.B --dhcp-luascript=<chemin>
|
||||||
Spécifie un script écrit en Lua, devant être exécuté lorsque des baux sont
|
Spécifie un script écrit en Lua, devant être exécuté lorsque des baux sont
|
||||||
@@ -1276,8 +1378,10 @@ et peut fournir des fonctions
|
|||||||
et
|
et
|
||||||
.B shutdown
|
.B shutdown
|
||||||
qui sont appellées, sans arguments, lorsque dnsmasq démarre ou s'arrête.
|
qui sont appellées, sans arguments, lorsque dnsmasq démarre ou s'arrête.
|
||||||
|
Il peut également fournir une fonction
|
||||||
|
.B tftp.
|
||||||
|
|
||||||
La méthode
|
La fonction
|
||||||
.B lease
|
.B lease
|
||||||
reçoit les informations détaillées dans
|
reçoit les informations détaillées dans
|
||||||
.B --dhcp-script.
|
.B --dhcp-script.
|
||||||
@@ -1301,6 +1405,16 @@ et
|
|||||||
ainsi que
|
ainsi que
|
||||||
.B hostname
|
.B hostname
|
||||||
(le nom d'hôte) dans le cas d'IPv6.
|
(le nom d'hôte) dans le cas d'IPv6.
|
||||||
|
|
||||||
|
La fonction
|
||||||
|
.B tftp
|
||||||
|
est appelée de la même façon que la fonction "lease", et la table contient les
|
||||||
|
labels
|
||||||
|
.B destination_address,
|
||||||
|
.B file_name
|
||||||
|
et
|
||||||
|
.B file_size
|
||||||
|
(respectivement "adresse de destination", "nom de fichier" et "taille de fichier").
|
||||||
.TP
|
.TP
|
||||||
.B --dhcp-scriptuser
|
.B --dhcp-scriptuser
|
||||||
Spécifie l'utilisateur sous lequel le script shell lease-change ou le script
|
Spécifie l'utilisateur sous lequel le script shell lease-change ou le script
|
||||||
@@ -1367,7 +1481,7 @@ Si la gamme d'adresse est fournie sous la forme
|
|||||||
qui a pour effect d'ajouter --local-declarations aux requêtes DNS directes et
|
qui a pour effect d'ajouter --local-declarations aux requêtes DNS directes et
|
||||||
inverses. C-à-d
|
inverses. C-à-d
|
||||||
.B --domain=thekelleys.org.uk,192.168.0.0/24,local
|
.B --domain=thekelleys.org.uk,192.168.0.0/24,local
|
||||||
est indentique à
|
est identique à
|
||||||
.B --domain=thekelleys.org.uk,192.168.0.0/24
|
.B --domain=thekelleys.org.uk,192.168.0.0/24
|
||||||
--local=/thekelleys.org.uk/ --local=/0.168.192.in-addr.arpa/
|
--local=/thekelleys.org.uk/ --local=/0.168.192.in-addr.arpa/
|
||||||
La taille de réseau doit-être de 8, 16 ou 24 pour être valide.
|
La taille de réseau doit-être de 8, 16 ou 24 pour être valide.
|
||||||
@@ -1411,17 +1525,21 @@ Advertisement") sont activées, dnsmasq va annoncer un préfixe pour chaque
|
|||||||
dhcp-range et, par défaut, fournir comme valeur de routeur et de DNS récursif
|
dhcp-range et, par défaut, fournir comme valeur de routeur et de DNS récursif
|
||||||
la valeur d'adresse link-local appropriée parmi celles de la machine sur
|
la valeur d'adresse link-local appropriée parmi celles de la machine sur
|
||||||
laquelle tourne dnsmasq.
|
laquelle tourne dnsmasq.
|
||||||
Les bits "managed address" sont positionnés, sauf pour un dhcp-range marqué
|
Par défaut, les bits "managed address" sont positionnés, et le bit "use SLAAC"
|
||||||
comme "ra-only" (annonce routeur uniquement). Dans ce cas le service d'annonce
|
("utiliser SLAAC") est réinitialisé. Cela peut-être changé pour des
|
||||||
routeur est rendu mais aucun service DHCPv6 n'est assuré, et les bits "managed
|
sous-réseaux donnés par le biais du mot clef de mode décris dans
|
||||||
address" ne sont pas positionnés.
|
.B --dhcp-range.
|
||||||
|
Les paramètres DNS du RFC6106 sont inclus dans les annonces. Par défaut,
|
||||||
|
l'adresse link-local appropriée parmi celles de la machine sur laquelle tourne
|
||||||
|
dnsmasq est spécifiée comme DNS récursif. Si elles sont fournies, les
|
||||||
|
options dns-server et domain-search sont utilisées respectivement pour RDNSS et
|
||||||
|
DNSSL.
|
||||||
.TP
|
.TP
|
||||||
.B --enable-tftp[=<interface>]
|
.B --enable-tftp
|
||||||
Active la fonction serveur TFTP. Celui-ci est de manière délibérée limité aux
|
Active la fonction serveur TFTP. Celui-ci est de manière délibérée limité aux
|
||||||
fonctions nécessaires au démarrage par le réseau ("net-boot") d'un client. Seul
|
fonctions nécessaires au démarrage par le réseau ("net-boot") d'un client. Seul
|
||||||
un accès en lecture est possible; les extensions tsize et blksize sont supportées
|
un accès en lecture est possible; les extensions tsize et blksize sont supportées
|
||||||
(tsize est seulement supporté en mode octet). Voir dans la section NOTES les
|
(tsize est seulement supporté en mode octet).
|
||||||
informations relatives à la spécification de l'interface.
|
|
||||||
.TP
|
.TP
|
||||||
.B --tftp-root=<répertoire>[,<interface>]
|
.B --tftp-root=<répertoire>[,<interface>]
|
||||||
Les fichiers à fournir dans les transferts TFTP seront cherchés en prenant le
|
Les fichiers à fournir dans les transferts TFTP seront cherchés en prenant le
|
||||||
@@ -1459,6 +1577,13 @@ Sans cela, en effet, l'accès de tous les fichiers du serveur pour lequel le
|
|||||||
droit de lecture pour tout le monde est positionné ("world-readable") devient
|
droit de lecture pour tout le monde est positionné ("world-readable") devient
|
||||||
possible par n'importe quel hôte sur le réseau.
|
possible par n'importe quel hôte sur le réseau.
|
||||||
.TP
|
.TP
|
||||||
|
.B --tftp-lowercase
|
||||||
|
Converti les noms de fichiers des requêtes TFTP en minuscules. Cela est utile
|
||||||
|
pour les requêtes effectuées depuis les machines Windows, dont les systèmes
|
||||||
|
de fichiers sont insensibles à la casse et pour lesquels la détermination
|
||||||
|
de la casse est parfois un peu aléatoire. A noter que le serveur tftp de
|
||||||
|
dnsmasq converti systématiquement les "\\" en "/" dans les noms de fichiers.
|
||||||
|
.TP
|
||||||
.B --tftp-max=<connexions>
|
.B --tftp-max=<connexions>
|
||||||
Définit le nombre maximum de connexions TFTP simultanées autorisées. La valeur
|
Définit le nombre maximum de connexions TFTP simultanées autorisées. La valeur
|
||||||
par défaut est de 50. Lorsqu'un grand nombre de connexions TFTP est spécifié,
|
par défaut est de 50. Lorsqu'un grand nombre de connexions TFTP est spécifié,
|
||||||
@@ -1722,51 +1847,6 @@ supprime la nécessité des associations statiques). Le paramètre
|
|||||||
que le label "bootp", permettant un certain contrôle sur les options retournées
|
que le label "bootp", permettant un certain contrôle sur les options retournées
|
||||||
aux différentes classes d'hôtes.
|
aux différentes classes d'hôtes.
|
||||||
|
|
||||||
Il est possible de spécifier un nom d'interface à
|
|
||||||
.B dhcp-range
|
|
||||||
sous la forme "interface:<nom d'interface>". La sémantique est comme suit :
|
|
||||||
Pour le DHCP, s'il existe une autre valeur de dhcp-range pour laquelle
|
|
||||||
_aucun_ nom d'interface n'est donné, alors le nom d'interface est ignoré
|
|
||||||
et dnsmasq se comporte comme si la partie spécifiant l'interface n'existait
|
|
||||||
pas, sinon le service DHCP n'est fourni qu'aux interfaces mentionnées dans
|
|
||||||
les déclarations dhcp-range. Pour le DNS, si il n'y a pas d'option
|
|
||||||
.B --interface
|
|
||||||
ou
|
|
||||||
.B --listen-address
|
|
||||||
, alors le comportement n'est pas impacté par la spécification d'interface. Si
|
|
||||||
l'une ou l'autre de ces options est présente, alors les interfaces mentionnées
|
|
||||||
dans les plages d'adresses dhcp-range sont rajoutées à la liste de celles
|
|
||||||
où le service DNS est assuré.
|
|
||||||
|
|
||||||
De manière similaire,
|
|
||||||
.B enable-tftp
|
|
||||||
peut prendre un nom d'interface, ce qui active le TFTP pour cette seule
|
|
||||||
interface, en ignorant les options
|
|
||||||
.B --interface
|
|
||||||
ou
|
|
||||||
.B --listen-address
|
|
||||||
De plus,
|
|
||||||
.B --tftp-secure
|
|
||||||
,
|
|
||||||
.B --tftp-unique-root
|
|
||||||
et
|
|
||||||
.B --tftp-no-blocksize
|
|
||||||
sont ignorées pour les requêtes sur de telles interfaces. (une directive
|
|
||||||
.B --tftp-root
|
|
||||||
donnant le chemin de la racine et une interface doit-être fournie).
|
|
||||||
|
|
||||||
Ces règles peuvent paraître étrange à première vue, mais elles permettent
|
|
||||||
d'ajouter à la configuration de dnsmasq des lignes de configuration de la
|
|
||||||
forme "dhcp-range=interface:virt0,192.168.0.4,192.168.0.200" afin de fournir
|
|
||||||
un service DHCP et DNS sur cette interface, sans pour autant affecter les
|
|
||||||
services fournis sur d'autres interfaces, malgré l'absence de paramètres
|
|
||||||
"interface=<interface>" sur les autres lignes de configuration.
|
|
||||||
"enable-tftp=virt0" et "tftp-root=<root>,virt0" effectuent la même chose pour
|
|
||||||
TFTP.
|
|
||||||
L'idée de tout cela est de permettre l'addition de telles lignes
|
|
||||||
automatiquement par libvirt ou un système équivalent, sans perturbation
|
|
||||||
d'une configuration manuelle existant par ailleurs.
|
|
||||||
|
|
||||||
.SH CODES DE SORTIE
|
.SH CODES DE SORTIE
|
||||||
.PP
|
.PP
|
||||||
0 - Dnsmasq s'est correctement lancé en tâche de fond, ou alors s'est
|
0 - Dnsmasq s'est correctement lancé en tâche de fond, ou alors s'est
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ msgstr ""
|
|||||||
"Project-Id-Version: dnsmasq 2.53rc1\n"
|
"Project-Id-Version: dnsmasq 2.53rc1\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2009-06-18 12:24+0100\n"
|
"POT-Creation-Date: 2009-06-18 12:24+0100\n"
|
||||||
"PO-Revision-Date: 2010-05-24 16:29+0200\n"
|
"PO-Revision-Date: 2012-04-05 17:54+0100\n"
|
||||||
"Last-Translator: Matthias Andree <matthias.andree@gmx.de>\n"
|
"Last-Translator: Conrad Kostecki <ConiKost@gmx.de>\n"
|
||||||
"Language-Team: German <de@li.org>\n"
|
"Language-Team: German <de@li.org>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
@@ -25,17 +25,20 @@ msgstr ""
|
|||||||
msgid "failed to load names from %s: %s"
|
msgid "failed to load names from %s: %s"
|
||||||
msgstr "Fehler beim Laden der Namen von %s: %s"
|
msgstr "Fehler beim Laden der Namen von %s: %s"
|
||||||
|
|
||||||
#: cache.c:797 dhcp.c:855
|
#: cache.c:797
|
||||||
|
#: dhcp.c:855
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "bad address at %s line %d"
|
msgid "bad address at %s line %d"
|
||||||
msgstr "Fehlerhafte Adresse in %s Zeile %d"
|
msgstr "Fehlerhafte Adresse in %s Zeile %d"
|
||||||
|
|
||||||
#: cache.c:846 dhcp.c:871
|
#: cache.c:846
|
||||||
|
#: dhcp.c:871
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "bad name at %s line %d"
|
msgid "bad name at %s line %d"
|
||||||
msgstr "Fehlerhafter Name in %s Zeile %d"
|
msgstr "Fehlerhafter Name in %s Zeile %d"
|
||||||
|
|
||||||
#: cache.c:853 dhcp.c:946
|
#: cache.c:853
|
||||||
|
#: dhcp.c:946
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "read %s - %d addresses"
|
msgid "read %s - %d addresses"
|
||||||
msgstr "%s gelesen - %d Adressen"
|
msgstr "%s gelesen - %d Adressen"
|
||||||
@@ -47,7 +50,7 @@ msgstr "Cache geleert"
|
|||||||
#: cache.c:953
|
#: cache.c:953
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "No IPv4 address found for %s"
|
msgid "No IPv4 address found for %s"
|
||||||
msgstr ""
|
msgstr "Keine IPv4-Adresse für %s gefunden"
|
||||||
|
|
||||||
#: cache.c:1005
|
#: cache.c:1005
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -88,7 +91,8 @@ msgstr "Konnte den Zufallszahlengenerator nicht initialisieren: %s"
|
|||||||
msgid "failed to allocate memory"
|
msgid "failed to allocate memory"
|
||||||
msgstr "Konnte Speicher nicht belegen"
|
msgstr "Konnte Speicher nicht belegen"
|
||||||
|
|
||||||
#: util.c:227 option.c:717
|
#: util.c:227
|
||||||
|
#: option.c:717
|
||||||
msgid "could not get memory"
|
msgid "could not get memory"
|
||||||
msgstr "Speicher nicht verfügbar"
|
msgstr "Speicher nicht verfügbar"
|
||||||
|
|
||||||
@@ -171,19 +175,16 @@ msgid "Set address or hostname for a specified machine."
|
|||||||
msgstr "Adresse oder Hostnamen für einen angegebenen Computer setzen."
|
msgstr "Adresse oder Hostnamen für einen angegebenen Computer setzen."
|
||||||
|
|
||||||
#: option.c:268
|
#: option.c:268
|
||||||
#, fuzzy
|
|
||||||
msgid "Read DHCP host specs from file."
|
msgid "Read DHCP host specs from file."
|
||||||
msgstr "DHCP-Host-Angaben aus Datei lesen"
|
msgstr "DHCP-Host-Angaben aus Datei lesen."
|
||||||
|
|
||||||
#: option.c:269
|
#: option.c:269
|
||||||
#, fuzzy
|
|
||||||
msgid "Read DHCP option specs from file."
|
msgid "Read DHCP option specs from file."
|
||||||
msgstr "DHCP-Optionen aus Datei lesen"
|
msgstr "DHCP-Optionen aus Datei lesen."
|
||||||
|
|
||||||
#: option.c:270
|
#: option.c:270
|
||||||
#, fuzzy
|
|
||||||
msgid "Evaluate conditional tag expression."
|
msgid "Evaluate conditional tag expression."
|
||||||
msgstr "Auswertung eines Ausdrucks bedingter Marken"
|
msgstr "Auswertung eines Ausdrucks bedingter Marken."
|
||||||
|
|
||||||
#: option.c:271
|
#: option.c:271
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -325,7 +326,6 @@ msgid "Specify time-to-live in seconds for negative caching."
|
|||||||
msgstr "Gültigkeitsdauer in Sekunden für Caching negativer Ergebnisse festlegen."
|
msgstr "Gültigkeitsdauer in Sekunden für Caching negativer Ergebnisse festlegen."
|
||||||
|
|
||||||
#: option.c:304
|
#: option.c:304
|
||||||
#, fuzzy
|
|
||||||
msgid "Specify time-to-live in seconds for maximum TTL to send to clients."
|
msgid "Specify time-to-live in seconds for maximum TTL to send to clients."
|
||||||
msgstr "Gültigkeitsdauer in Sekunden für Caching negativer Ergebnisse festlegen."
|
msgstr "Gültigkeitsdauer in Sekunden für Caching negativer Ergebnisse festlegen."
|
||||||
|
|
||||||
@@ -414,17 +414,14 @@ msgid "Disable ICMP echo address checking in the DHCP server."
|
|||||||
msgstr "ICMP-Echo-Adressprüfung im DHCP-Server abschalten."
|
msgstr "ICMP-Echo-Adressprüfung im DHCP-Server abschalten."
|
||||||
|
|
||||||
#: option.c:325
|
#: option.c:325
|
||||||
#, fuzzy
|
|
||||||
msgid "Shell script to run on DHCP lease creation and destruction."
|
msgid "Shell script to run on DHCP lease creation and destruction."
|
||||||
msgstr "Skript, das bei Erzeugung/Löschung einer DHCP-Lease laufen soll."
|
msgstr "Skript, das bei Erzeugung/Löschung einer DHCP-Lease laufen soll."
|
||||||
|
|
||||||
#: option.c:326
|
#: option.c:326
|
||||||
#, fuzzy
|
|
||||||
msgid "Lua script to run on DHCP lease creation and destruction."
|
msgid "Lua script to run on DHCP lease creation and destruction."
|
||||||
msgstr "Skript, das bei Erzeugung/Löschung einer DHCP-Lease laufen soll."
|
msgstr "Lua-Skript, welches bei Erzeugung/Löschung eines DHCP-Leases laufen soll."
|
||||||
|
|
||||||
#: option.c:327
|
#: option.c:327
|
||||||
#, fuzzy
|
|
||||||
msgid "Run lease-change scripts as this user."
|
msgid "Run lease-change scripts as this user."
|
||||||
msgstr "Lease-Änderungs-Skript mit den Rechten dieses Nutzers ausführen."
|
msgstr "Lease-Änderungs-Skript mit den Rechten dieses Nutzers ausführen."
|
||||||
|
|
||||||
@@ -504,7 +501,6 @@ msgid "Allow rebinding of 127.0.0.0/8, for RBL servers."
|
|||||||
msgstr "Auflösung zu 127.0.0.0/8 erlauben, für RBL-Server."
|
msgstr "Auflösung zu 127.0.0.0/8 erlauben, für RBL-Server."
|
||||||
|
|
||||||
#: option.c:346
|
#: option.c:346
|
||||||
#, fuzzy
|
|
||||||
msgid "Inhibit DNS-rebind protection on this domain."
|
msgid "Inhibit DNS-rebind protection on this domain."
|
||||||
msgstr "DNS-Rebind-Schutz für diese Domäne sperren."
|
msgstr "DNS-Rebind-Schutz für diese Domäne sperren."
|
||||||
|
|
||||||
@@ -534,9 +530,8 @@ msgstr "Für DHCP-Klienten nur vollständig bestimmte Domänennamen benutzen."
|
|||||||
|
|
||||||
# FIXME: probably typo in original message. -- MA
|
# FIXME: probably typo in original message. -- MA
|
||||||
#: option.c:353
|
#: option.c:353
|
||||||
#, fuzzy
|
|
||||||
msgid "Generate hostnames based on MAC address for nameless clients."
|
msgid "Generate hostnames based on MAC address for nameless clients."
|
||||||
msgstr "Für namenlose Klienten die Hostnamen MAC-basiert erzeugen."
|
msgstr "Generiere Hostnamen auf Basis der MAC-Adresse für namenlose Klienten."
|
||||||
|
|
||||||
#: option.c:354
|
#: option.c:354
|
||||||
msgid "Use these DHCP relays as full proxies."
|
msgid "Use these DHCP relays as full proxies."
|
||||||
@@ -560,28 +555,27 @@ msgstr "Konfigurationssyntax prüfen."
|
|||||||
|
|
||||||
#: option.c:359
|
#: option.c:359
|
||||||
msgid "Add requestor's MAC address to forwarded DNS queries."
|
msgid "Add requestor's MAC address to forwarded DNS queries."
|
||||||
msgstr ""
|
msgstr "Anfragende MAC-Adresse in die weiterleitende DNS-Anfrage einfügen"
|
||||||
|
|
||||||
#: option.c:360
|
#: option.c:360
|
||||||
#, fuzzy
|
|
||||||
msgid "Proxy DNSSEC validation results from upstream nameservers."
|
msgid "Proxy DNSSEC validation results from upstream nameservers."
|
||||||
msgstr "IPv4-Adressen von vorgelagerten Servern übersetzen."
|
msgstr "Proxy-DNSSEC-Validierung-Ergebnisse von Upstream-Namensservern."
|
||||||
|
|
||||||
#: option.c:361
|
#: option.c:361
|
||||||
msgid "Attempt to allocate sequential IP addresses to DHCP clients."
|
msgid "Attempt to allocate sequential IP addresses to DHCP clients."
|
||||||
msgstr ""
|
msgstr "Versuche sequenzielle IP-Adressen an DHCP-Klienten zu vergeben."
|
||||||
|
|
||||||
#: option.c:362
|
#: option.c:362
|
||||||
msgid "Copy connection-track mark from queries to upstream connections."
|
msgid "Copy connection-track mark from queries to upstream connections."
|
||||||
msgstr ""
|
msgstr "Kopiere \"connection-track mark\" von Anfragen nach Upstream-Verbindungen."
|
||||||
|
|
||||||
#: option.c:363
|
#: option.c:363
|
||||||
msgid "Allow DHCP clients to do their own DDNS updates."
|
msgid "Allow DHCP clients to do their own DDNS updates."
|
||||||
msgstr ""
|
msgstr "Erlaube DHCP-Klienten ihre eigenen DDNS-Updates durchzuführen."
|
||||||
|
|
||||||
#: option.c:364
|
#: option.c:364
|
||||||
msgid "Send router-advertisements for interfaces doing DHCPv6"
|
msgid "Send router-advertisements for interfaces doing DHCPv6"
|
||||||
msgstr ""
|
msgstr "Sende \"Router-Advertisments\" für Netzwerkschnittstellen, welche DHCPv6 nutzen"
|
||||||
|
|
||||||
#: option.c:782
|
#: option.c:782
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -608,13 +602,13 @@ msgid "Known DHCP options:\n"
|
|||||||
msgstr "Bekannte DHCP-Optionen:\n"
|
msgstr "Bekannte DHCP-Optionen:\n"
|
||||||
|
|
||||||
#: option.c:838
|
#: option.c:838
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "Known DHCPv6 options:\n"
|
msgid "Known DHCPv6 options:\n"
|
||||||
msgstr "Bekannte DHCP-Optionen:\n"
|
msgstr "Bekannte DHCPv6-Optionen:\n"
|
||||||
|
|
||||||
#: option.c:973
|
#: option.c:973
|
||||||
msgid "unsupported encapsulation for IPv6 option"
|
msgid "unsupported encapsulation for IPv6 option"
|
||||||
msgstr ""
|
msgstr "Nicht unterstützte Verkapselung für eine IPv6-Option"
|
||||||
|
|
||||||
#: option.c:1001
|
#: option.c:1001
|
||||||
msgid "bad dhcp-option"
|
msgid "bad dhcp-option"
|
||||||
@@ -624,10 +618,11 @@ msgstr "Fehlerhafte DHCP-Option"
|
|||||||
msgid "bad IP address"
|
msgid "bad IP address"
|
||||||
msgstr "Fehlerhafte IP-Adresse"
|
msgstr "Fehlerhafte IP-Adresse"
|
||||||
|
|
||||||
#: option.c:1071 option.c:1177 option.c:2511
|
#: option.c:1071
|
||||||
#, fuzzy
|
#: option.c:1177
|
||||||
|
#: option.c:2511
|
||||||
msgid "bad IPv6 address"
|
msgid "bad IPv6 address"
|
||||||
msgstr "Fehlerhafte IP-Adresse"
|
msgstr "Fehlerhafte IPv6-Adresse"
|
||||||
|
|
||||||
#: option.c:1205
|
#: option.c:1205
|
||||||
msgid "bad domain in dhcp-option"
|
msgid "bad domain in dhcp-option"
|
||||||
@@ -649,23 +644,25 @@ msgstr "unzulässig wiederholte Markierung"
|
|||||||
msgid "illegal repeated keyword"
|
msgid "illegal repeated keyword"
|
||||||
msgstr "unzulässig wiederholtes Schlüsselwort"
|
msgstr "unzulässig wiederholtes Schlüsselwort"
|
||||||
|
|
||||||
#: option.c:1452 option.c:3536
|
#: option.c:1452
|
||||||
|
#: option.c:3536
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "cannot access directory %s: %s"
|
msgid "cannot access directory %s: %s"
|
||||||
msgstr "Kann auf Verzeichnis %s nicht zugreifen: %s"
|
msgstr "Kann auf Verzeichnis %s nicht zugreifen: %s"
|
||||||
|
|
||||||
#: option.c:1483 tftp.c:464
|
#: option.c:1483
|
||||||
|
#: tftp.c:464
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "cannot access %s: %s"
|
msgid "cannot access %s: %s"
|
||||||
msgstr "Kann auf %s nicht zugreifen: %s"
|
msgstr "Kann auf %s nicht zugreifen: %s"
|
||||||
|
|
||||||
#: option.c:1512
|
#: option.c:1512
|
||||||
msgid "setting log facility is not possible under Android"
|
msgid "setting log facility is not possible under Android"
|
||||||
msgstr ""
|
msgstr "Die Einstellung Protokolliereinrichtung kann unter Android nicht gesetzt werden"
|
||||||
|
|
||||||
#: option.c:1521
|
#: option.c:1521
|
||||||
msgid "bad log facility"
|
msgid "bad log facility"
|
||||||
msgstr ""
|
msgstr "Falsche Protokolliereinrichtung"
|
||||||
|
|
||||||
#: option.c:1570
|
#: option.c:1570
|
||||||
msgid "bad MX preference"
|
msgid "bad MX preference"
|
||||||
@@ -688,19 +685,21 @@ msgid "recompile with HAVE_SCRIPT defined to enable lease-change scripts"
|
|||||||
msgstr "Neuübersetzung mit HAVE_SCRIPT nötig, um Lease-Änderungs-Skripte auszuführen"
|
msgstr "Neuübersetzung mit HAVE_SCRIPT nötig, um Lease-Änderungs-Skripte auszuführen"
|
||||||
|
|
||||||
#: option.c:1607
|
#: option.c:1607
|
||||||
#, fuzzy
|
|
||||||
msgid "recompile with HAVE_LUASCRIPT defined to enable Lua scripts"
|
msgid "recompile with HAVE_LUASCRIPT defined to enable Lua scripts"
|
||||||
msgstr "Neuübersetzung mit HAVE_SCRIPT nötig, um Lease-Änderungs-Skripte auszuführen"
|
msgstr "Um Benutzerdefinierte Lua-Scripte zu ermöglichen, muss mit HAVE_LUASCRIPT neu kompiliert werden"
|
||||||
|
|
||||||
#: option.c:1988 option.c:1992
|
#: option.c:1988
|
||||||
|
#: option.c:1992
|
||||||
msgid "bad port"
|
msgid "bad port"
|
||||||
msgstr "unzulässiger Port"
|
msgstr "unzulässiger Port"
|
||||||
|
|
||||||
#: option.c:2015 option.c:2046
|
#: option.c:2015
|
||||||
|
#: option.c:2046
|
||||||
msgid "interface binding not supported"
|
msgid "interface binding not supported"
|
||||||
msgstr "Schnittstellenbindung nicht unterstützt"
|
msgstr "Schnittstellenbindung nicht unterstützt"
|
||||||
|
|
||||||
#: option.c:2026 option.c:3088
|
#: option.c:2026
|
||||||
|
#: option.c:3088
|
||||||
msgid "bad interface name"
|
msgid "bad interface name"
|
||||||
msgstr "unzulässiger Schnittestellenname"
|
msgstr "unzulässiger Schnittestellenname"
|
||||||
|
|
||||||
@@ -726,20 +725,20 @@ msgstr "inkonsistenter DHCP-Bereich"
|
|||||||
|
|
||||||
#: option.c:2374
|
#: option.c:2374
|
||||||
msgid "prefix must be at least 64"
|
msgid "prefix must be at least 64"
|
||||||
msgstr ""
|
msgstr "Der Prefix muss mindestens 64 sein"
|
||||||
|
|
||||||
#: option.c:2378
|
#: option.c:2378
|
||||||
#, fuzzy
|
|
||||||
msgid "inconsistent DHCPv6 range"
|
msgid "inconsistent DHCPv6 range"
|
||||||
msgstr "inkonsistenter DHCP-Bereich"
|
msgstr "Inkonsistenter DHCPv6-Bereich"
|
||||||
|
|
||||||
#: option.c:2481 option.c:2521
|
#: option.c:2481
|
||||||
|
#: option.c:2521
|
||||||
msgid "bad hex constant"
|
msgid "bad hex constant"
|
||||||
msgstr ""
|
msgstr "Falscher Hexwert"
|
||||||
|
|
||||||
#: option.c:2503
|
#: option.c:2503
|
||||||
msgid "cannot match tags in --dhcp-host"
|
msgid "cannot match tags in --dhcp-host"
|
||||||
msgstr ""
|
msgstr "Kann die Tags in --dhcp-host nicht abgleichen"
|
||||||
|
|
||||||
#: option.c:2583
|
#: option.c:2583
|
||||||
msgid "bad DHCP host name"
|
msgid "bad DHCP host name"
|
||||||
@@ -749,7 +748,8 @@ msgstr "unzulässiger DHCP-Hostname"
|
|||||||
msgid "bad tag-if"
|
msgid "bad tag-if"
|
||||||
msgstr "unzulässige bedingte Marke (tag-if)"
|
msgstr "unzulässige bedingte Marke (tag-if)"
|
||||||
|
|
||||||
#: option.c:2973 option.c:3258
|
#: option.c:2973
|
||||||
|
#: option.c:3258
|
||||||
msgid "invalid port number"
|
msgid "invalid port number"
|
||||||
msgstr "unzulässige Portnummer"
|
msgstr "unzulässige Portnummer"
|
||||||
|
|
||||||
@@ -826,19 +826,21 @@ msgstr "Fehler"
|
|||||||
msgid "%s at line %d of %%s"
|
msgid "%s at line %d of %%s"
|
||||||
msgstr "%s in Zeile %d von %%s"
|
msgstr "%s in Zeile %d von %%s"
|
||||||
|
|
||||||
#: option.c:3491 tftp.c:627
|
#: option.c:3491
|
||||||
|
#: tftp.c:627
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "cannot read %s: %s"
|
msgid "cannot read %s: %s"
|
||||||
msgstr "kann %s nicht lesen: %s"
|
msgstr "kann %s nicht lesen: %s"
|
||||||
|
|
||||||
#: option.c:3657 option.c:3693
|
#: option.c:3657
|
||||||
|
#: option.c:3693
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "read %s"
|
msgid "read %s"
|
||||||
msgstr "%s gelesen"
|
msgstr "%s gelesen"
|
||||||
|
|
||||||
#: option.c:3745
|
#: option.c:3745
|
||||||
msgid "junk found in command line"
|
msgid "junk found in command line"
|
||||||
msgstr ""
|
msgstr "Mist in der Kommandozeile gefunden"
|
||||||
|
|
||||||
#: option.c:3780
|
#: option.c:3780
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -846,12 +848,12 @@ msgid "Dnsmasq version %s %s\n"
|
|||||||
msgstr "Dnsmasq Version %s %s\n"
|
msgstr "Dnsmasq Version %s %s\n"
|
||||||
|
|
||||||
#: option.c:3781
|
#: option.c:3781
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"Compile time options: %s\n"
|
"Compile time options: %s\n"
|
||||||
"\n"
|
"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Übersetzungs-Optionen %s\n"
|
"Kompilierungs-Optionen %s\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
||||||
#: option.c:3782
|
#: option.c:3782
|
||||||
@@ -863,12 +865,12 @@ msgstr "Für diese Software wird ABSOLUT KEINE GARANTIE gewährt.\n"
|
|||||||
#: option.c:3783
|
#: option.c:3783
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Dnsmasq is free software, and you are welcome to redistribute it\n"
|
msgid "Dnsmasq is free software, and you are welcome to redistribute it\n"
|
||||||
msgstr ""
|
msgstr "Dnsmasq ist freie Software, und du bist willkommen es weiter zu verteilen\n"
|
||||||
|
|
||||||
#: option.c:3784
|
#: option.c:3784
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "under the terms of the GNU General Public License, version 2 or 3.\n"
|
msgid "under the terms of the GNU General Public License, version 2 or 3.\n"
|
||||||
msgstr ""
|
msgstr "unter den Bedingungen der GNU General Public Lizenz, Version 2 oder 3.\n"
|
||||||
|
|
||||||
#: option.c:3795
|
#: option.c:3795
|
||||||
msgid "try --help"
|
msgid "try --help"
|
||||||
@@ -896,7 +898,9 @@ msgstr "mit -n/--no-poll ist nur eine resolv.conf-Datei zulässig."
|
|||||||
msgid "must have exactly one resolv.conf to read domain from."
|
msgid "must have exactly one resolv.conf to read domain from."
|
||||||
msgstr "Um die Domäne zu lesen, muss genau eine resolv.conf-Datei verwendet werden."
|
msgstr "Um die Domäne zu lesen, muss genau eine resolv.conf-Datei verwendet werden."
|
||||||
|
|
||||||
#: option.c:3882 network.c:822 dhcp.c:804
|
#: option.c:3882
|
||||||
|
#: network.c:822
|
||||||
|
#: dhcp.c:804
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "failed to read %s: %s"
|
msgid "failed to read %s: %s"
|
||||||
msgstr "konnte %s nicht lesen: %s"
|
msgstr "konnte %s nicht lesen: %s"
|
||||||
@@ -907,18 +911,17 @@ msgid "no search directive found in %s"
|
|||||||
msgstr "keine \"search\"-Anweisung in %s gefunden"
|
msgstr "keine \"search\"-Anweisung in %s gefunden"
|
||||||
|
|
||||||
#: option.c:3920
|
#: option.c:3920
|
||||||
#, fuzzy
|
|
||||||
msgid "there must be a default domain when --dhcp-fqdn is set"
|
msgid "there must be a default domain when --dhcp-fqdn is set"
|
||||||
msgstr "für --dhcp-fqdn muss eine Domäne vorausgewählt werden"
|
msgstr "Es muss eine standard Domain gesetzt sein, wenn --dhcp-fqdn gesetzt ist"
|
||||||
|
|
||||||
#: option.c:3924
|
#: option.c:3924
|
||||||
msgid "syntax check OK"
|
msgid "syntax check OK"
|
||||||
msgstr "Syntaxprüfung OK"
|
msgstr "Syntaxprüfung OK"
|
||||||
|
|
||||||
#: forward.c:113
|
#: forward.c:113
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "failed to send packet: %s"
|
msgid "failed to send packet: %s"
|
||||||
msgstr "konnte Socket nicht zum Empfang einrichten: %s"
|
msgstr "Fehlgeschlagen, folgendes Paket zu senden: %s"
|
||||||
|
|
||||||
#: forward.c:474
|
#: forward.c:474
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -931,9 +934,9 @@ msgid "possible DNS-rebind attack detected: %s"
|
|||||||
msgstr "möglichen DNS-Rebind-Angriff entdeckt: %s"
|
msgstr "möglichen DNS-Rebind-Angriff entdeckt: %s"
|
||||||
|
|
||||||
#: network.c:355
|
#: network.c:355
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "failed to create listening socket for %s: %s"
|
msgid "failed to create listening socket for %s: %s"
|
||||||
msgstr "Konnte Empfangs-Socket nicht erzeugen: %s"
|
msgstr "Konnte Empfangs-Socket für %s: %s nicht erzeugen"
|
||||||
|
|
||||||
#: network.c:720
|
#: network.c:720
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -953,44 +956,44 @@ msgstr "ignoriere Namensserver %s - kann Socket nicht erzeugen/binden: %s"
|
|||||||
# FIXME: this isn't translatable - always provide full strings, do not assemble yourself! -- MA
|
# FIXME: this isn't translatable - always provide full strings, do not assemble yourself! -- MA
|
||||||
#: network.c:785
|
#: network.c:785
|
||||||
msgid "unqualified"
|
msgid "unqualified"
|
||||||
msgstr ""
|
msgstr "unqualifiziert"
|
||||||
|
|
||||||
#: network.c:785
|
#: network.c:785
|
||||||
msgid "names"
|
msgid "names"
|
||||||
msgstr ""
|
msgstr "Namen"
|
||||||
|
|
||||||
#: network.c:787
|
#: network.c:787
|
||||||
msgid "default"
|
msgid "default"
|
||||||
msgstr ""
|
msgstr "Standard"
|
||||||
|
|
||||||
#: network.c:789
|
#: network.c:789
|
||||||
msgid "domain"
|
msgid "domain"
|
||||||
msgstr ""
|
msgstr "Domain"
|
||||||
|
|
||||||
#: network.c:792
|
#: network.c:792
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "using local addresses only for %s %s"
|
msgid "using local addresses only for %s %s"
|
||||||
msgstr ""
|
msgstr "Benutze lokale Adressen nur für %s %s"
|
||||||
|
|
||||||
#: network.c:794
|
#: network.c:794
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "using standard nameservers for %s %s"
|
msgid "using standard nameservers for %s %s"
|
||||||
msgstr ""
|
msgstr "Benutze standard Namensserver für %s %s"
|
||||||
|
|
||||||
#: network.c:796
|
#: network.c:796
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "using nameserver %s#%d for %s %s"
|
msgid "using nameserver %s#%d for %s %s"
|
||||||
msgstr ""
|
msgstr "Benutze Namensserver %s#%d für %s %s"
|
||||||
|
|
||||||
#: network.c:799
|
#: network.c:799
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "using nameserver %s#%d(via %s)"
|
msgid "using nameserver %s#%d(via %s)"
|
||||||
msgstr ""
|
msgstr "Benutze Namensserver %s#%d(via %s)"
|
||||||
|
|
||||||
#: network.c:801
|
#: network.c:801
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "using nameserver %s#%d"
|
msgid "using nameserver %s#%d"
|
||||||
msgstr ""
|
msgstr "Benutze Namensserver %s#%d"
|
||||||
|
|
||||||
#: dnsmasq.c:123
|
#: dnsmasq.c:123
|
||||||
msgid "TFTP server not available: set HAVE_TFTP in src/config.h"
|
msgid "TFTP server not available: set HAVE_TFTP in src/config.h"
|
||||||
@@ -998,21 +1001,19 @@ msgstr "TFTP-Server nicht verfügbar, setzen Sie HAVE_TFTP in src/config.h"
|
|||||||
|
|
||||||
#: dnsmasq.c:128
|
#: dnsmasq.c:128
|
||||||
msgid "Cannot use --conntrack AND --query-port"
|
msgid "Cannot use --conntrack AND --query-port"
|
||||||
msgstr ""
|
msgstr "Kann nicht --conntrack UND --query-port einsetzen"
|
||||||
|
|
||||||
#: dnsmasq.c:131
|
#: dnsmasq.c:131
|
||||||
#, fuzzy
|
|
||||||
msgid "Conntrack support not available: set HAVE_CONNTRACK in src/config.h"
|
msgid "Conntrack support not available: set HAVE_CONNTRACK in src/config.h"
|
||||||
msgstr "TFTP-Server nicht verfügbar, setzen Sie HAVE_TFTP in src/config.h"
|
msgstr "Conntrack-Unterstützung nicht verfügbar: setze HAVE_CONNTRACK in src/config.h"
|
||||||
|
|
||||||
#: dnsmasq.c:136
|
#: dnsmasq.c:136
|
||||||
msgid "asychronous logging is not available under Solaris"
|
msgid "asychronous logging is not available under Solaris"
|
||||||
msgstr "asynchrone Protokollierung unter Solaris nicht verfügbar"
|
msgstr "asynchrone Protokollierung unter Solaris nicht verfügbar"
|
||||||
|
|
||||||
#: dnsmasq.c:141
|
#: dnsmasq.c:141
|
||||||
#, fuzzy
|
|
||||||
msgid "asychronous logging is not available under Android"
|
msgid "asychronous logging is not available under Android"
|
||||||
msgstr "asynchrone Protokollierung unter Solaris nicht verfügbar"
|
msgstr "Asynchrone Protokollierung unter Android nicht verfügbar"
|
||||||
|
|
||||||
#: dnsmasq.c:190
|
#: dnsmasq.c:190
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1029,7 +1030,8 @@ msgstr "unbekannte Schnittstelle %s"
|
|||||||
msgid "no interface with address %s"
|
msgid "no interface with address %s"
|
||||||
msgstr "keine Schnittstelle mit Adresse %s"
|
msgstr "keine Schnittstelle mit Adresse %s"
|
||||||
|
|
||||||
#: dnsmasq.c:220 dnsmasq.c:770
|
#: dnsmasq.c:220
|
||||||
|
#: dnsmasq.c:770
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "DBus error: %s"
|
msgid "DBus error: %s"
|
||||||
msgstr "DBus-Fehler: %s"
|
msgstr "DBus-Fehler: %s"
|
||||||
@@ -1062,7 +1064,7 @@ msgstr "gestartet, Version %s, Cachegröße %d"
|
|||||||
#: dnsmasq.c:485
|
#: dnsmasq.c:485
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "started, version %s cache disabled"
|
msgid "started, version %s cache disabled"
|
||||||
msgstr ""
|
msgstr "Gestartet, Version %s Cache deaktiviert"
|
||||||
|
|
||||||
#: dnsmasq.c:487
|
#: dnsmasq.c:487
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1106,7 +1108,7 @@ msgstr "asynchrone Protokollierung eingeschaltet, Warteschlange fasst %d Nachric
|
|||||||
|
|
||||||
#: dnsmasq.c:524
|
#: dnsmasq.c:524
|
||||||
msgid "IPv6 router advertisement enabled"
|
msgid "IPv6 router advertisement enabled"
|
||||||
msgstr ""
|
msgstr "IPv6-Router-Advertisement aktiviert"
|
||||||
|
|
||||||
#: dnsmasq.c:554
|
#: dnsmasq.c:554
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1114,9 +1116,9 @@ msgid "DHCP, static leases only on %.0s%s, lease time %s"
|
|||||||
msgstr "DHCP, nur statische Leases auf %.0s%s, Lease-Zeit %s"
|
msgstr "DHCP, nur statische Leases auf %.0s%s, Lease-Zeit %s"
|
||||||
|
|
||||||
#: dnsmasq.c:556
|
#: dnsmasq.c:556
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "router advertisement only on %.0s%s, lifetime %s"
|
msgid "router advertisement only on %.0s%s, lifetime %s"
|
||||||
msgstr "DHCP, nur statische Leases auf %.0s%s, Lease-Zeit %s"
|
msgstr "Router-Advertisment nur auf %.0s%s, Lebenszeit %s"
|
||||||
|
|
||||||
#: dnsmasq.c:558
|
#: dnsmasq.c:558
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1128,17 +1130,18 @@ msgstr "DHCP, Proxy im Subnetz %.0s%s%.0s"
|
|||||||
msgid "DHCP, IP range %s -- %s, lease time %s"
|
msgid "DHCP, IP range %s -- %s, lease time %s"
|
||||||
msgstr "DHCP, IP-Bereich %s - %s, Lease-Zeit %s "
|
msgstr "DHCP, IP-Bereich %s - %s, Lease-Zeit %s "
|
||||||
|
|
||||||
|
# FIXME: this and the next few must be full strings to be translatable - do not assemble in code"
|
||||||
#: dnsmasq.c:588
|
#: dnsmasq.c:588
|
||||||
msgid "root is "
|
msgid "root is "
|
||||||
msgstr "FIXME: this and the next few must be full strings to be translatable - do not assemble in code"
|
msgstr "Wurzel ist"
|
||||||
|
|
||||||
#: dnsmasq.c:588
|
#: dnsmasq.c:588
|
||||||
msgid "enabled"
|
msgid "enabled"
|
||||||
msgstr ""
|
msgstr "Aktiviert"
|
||||||
|
|
||||||
#: dnsmasq.c:590
|
#: dnsmasq.c:590
|
||||||
msgid "secure mode"
|
msgid "secure mode"
|
||||||
msgstr ""
|
msgstr "sicherer Modus"
|
||||||
|
|
||||||
#: dnsmasq.c:616
|
#: dnsmasq.c:616
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1180,24 +1183,24 @@ msgid "failed to open pidfile %s: %s"
|
|||||||
msgstr "kann die Prozessidentifikations-(PID)-Datei %s nicht öffnen: %s"
|
msgstr "kann die Prozessidentifikations-(PID)-Datei %s nicht öffnen: %s"
|
||||||
|
|
||||||
#: dnsmasq.c:930
|
#: dnsmasq.c:930
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "cannot open log %s: %s"
|
msgid "cannot open log %s: %s"
|
||||||
msgstr "kann %s nicht öffnen: %s"
|
msgstr "Kann Logdatei %s nicht öffnen: %s"
|
||||||
|
|
||||||
#: dnsmasq.c:933
|
#: dnsmasq.c:933
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "failed to load Lua script: %s"
|
msgid "failed to load Lua script: %s"
|
||||||
msgstr "konnte %s nicht lesen: %s"
|
msgstr "Konnte Lua-Script nicht laden: %s"
|
||||||
|
|
||||||
#: dnsmasq.c:1002
|
#: dnsmasq.c:1002
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "script process killed by signal %d"
|
msgid "script process killed by signal %d"
|
||||||
msgstr "Tochterprozess durch Signal %d zerstört"
|
msgstr "Scriptprozess durch Signal %d getötet"
|
||||||
|
|
||||||
#: dnsmasq.c:1006
|
#: dnsmasq.c:1006
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "script process exited with status %d"
|
msgid "script process exited with status %d"
|
||||||
msgstr "Tochterprozess beendete sich mit Status %d"
|
msgstr "Scriptprozess hat sich mit Status %d beendet"
|
||||||
|
|
||||||
#: dnsmasq.c:1010
|
#: dnsmasq.c:1010
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1308,22 +1311,23 @@ msgstr "Ignoriere Domäne %s für DHCP-Hostnamen %s"
|
|||||||
#: rfc2131.c:337
|
#: rfc2131.c:337
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "no address range available for DHCP request %s %s"
|
msgid "no address range available for DHCP request %s %s"
|
||||||
msgstr ""
|
msgstr "Kein verfügbarer DHCP-Bereich für Anfrage %s %s"
|
||||||
|
|
||||||
#: rfc2131.c:338
|
#: rfc2131.c:338
|
||||||
msgid "with subnet selector"
|
msgid "with subnet selector"
|
||||||
msgstr ""
|
msgstr "mit Subnetz-Wähler"
|
||||||
|
|
||||||
#: rfc2131.c:338
|
#: rfc2131.c:338
|
||||||
msgid "via"
|
msgid "via"
|
||||||
msgstr ""
|
msgstr "via"
|
||||||
|
|
||||||
#: rfc2131.c:350
|
#: rfc2131.c:350
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%u available DHCP subnet: %s/%s"
|
msgid "%u available DHCP subnet: %s/%s"
|
||||||
msgstr "%u verfügbare(s) DHCP-Subnetz: %s/%s"
|
msgstr "%u verfügbare(s) DHCP-Subnetz: %s/%s"
|
||||||
|
|
||||||
#: rfc2131.c:353 rfc3315.c:209
|
#: rfc2131.c:353
|
||||||
|
#: rfc3315.c:209
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%u available DHCP range: %s -- %s"
|
msgid "%u available DHCP range: %s -- %s"
|
||||||
msgstr "%u verfügbare(r) DHCP-Bereich: %s - %s"
|
msgstr "%u verfügbare(r) DHCP-Bereich: %s - %s"
|
||||||
@@ -1331,33 +1335,40 @@ msgstr "%u verfügbare(r) DHCP-Bereich: %s - %s"
|
|||||||
# FIXME: do not programmatically assemble strings - untranslatable
|
# FIXME: do not programmatically assemble strings - untranslatable
|
||||||
#: rfc2131.c:382
|
#: rfc2131.c:382
|
||||||
msgid "disabled"
|
msgid "disabled"
|
||||||
msgstr ""
|
msgstr "deaktiviert"
|
||||||
|
|
||||||
#: rfc2131.c:423 rfc2131.c:941 rfc2131.c:1341
|
#: rfc2131.c:423
|
||||||
|
#: rfc2131.c:941
|
||||||
|
#: rfc2131.c:1341
|
||||||
msgid "ignored"
|
msgid "ignored"
|
||||||
msgstr ""
|
msgstr "ignoriert"
|
||||||
|
|
||||||
#: rfc2131.c:438 rfc2131.c:1179
|
#: rfc2131.c:438
|
||||||
|
#: rfc2131.c:1179
|
||||||
msgid "address in use"
|
msgid "address in use"
|
||||||
msgstr ""
|
msgstr "Adresse in Nutzung"
|
||||||
|
|
||||||
#: rfc2131.c:452 rfc2131.c:995
|
#: rfc2131.c:452
|
||||||
|
#: rfc2131.c:995
|
||||||
msgid "no address available"
|
msgid "no address available"
|
||||||
msgstr ""
|
msgstr "Keine Adresse verfügbar"
|
||||||
|
|
||||||
#: rfc2131.c:459 rfc2131.c:1142
|
#: rfc2131.c:459
|
||||||
|
#: rfc2131.c:1142
|
||||||
msgid "wrong network"
|
msgid "wrong network"
|
||||||
msgstr ""
|
msgstr "Falsches Netzwerk"
|
||||||
|
|
||||||
#: rfc2131.c:474
|
#: rfc2131.c:474
|
||||||
msgid "no address configured"
|
msgid "no address configured"
|
||||||
msgstr ""
|
msgstr "Keine Adresse konfiguriert"
|
||||||
|
|
||||||
#: rfc2131.c:480 rfc2131.c:1192
|
#: rfc2131.c:480
|
||||||
|
#: rfc2131.c:1192
|
||||||
msgid "no leases left"
|
msgid "no leases left"
|
||||||
msgstr ""
|
msgstr "Keine Leases übrig"
|
||||||
|
|
||||||
#: rfc2131.c:564 rfc3315.c:362
|
#: rfc2131.c:564
|
||||||
|
#: rfc3315.c:362
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%u client provides name: %s"
|
msgid "%u client provides name: %s"
|
||||||
msgstr "%u Klient stellt Name bereit: %s"
|
msgstr "%u Klient stellt Name bereit: %s"
|
||||||
@@ -1376,7 +1387,8 @@ msgstr "%u Benutzerklasse: %s"
|
|||||||
msgid "PXE BIS not supported"
|
msgid "PXE BIS not supported"
|
||||||
msgstr "PXE BIS nicht unterstützt"
|
msgstr "PXE BIS nicht unterstützt"
|
||||||
|
|
||||||
#: rfc2131.c:911 rfc3315.c:1098
|
#: rfc2131.c:911
|
||||||
|
#: rfc3315.c:1098
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "disabling DHCP static address %s for %s"
|
msgid "disabling DHCP static address %s for %s"
|
||||||
msgstr "schalte statische DHCP-Adresse %s für %s ab"
|
msgstr "schalte statische DHCP-Adresse %s für %s ab"
|
||||||
@@ -1384,9 +1396,10 @@ msgstr "schalte statische DHCP-Adresse %s für %s ab"
|
|||||||
# FIXME: do not assemble
|
# FIXME: do not assemble
|
||||||
#: rfc2131.c:932
|
#: rfc2131.c:932
|
||||||
msgid "unknown lease"
|
msgid "unknown lease"
|
||||||
msgstr ""
|
msgstr "Unbekannter Lease"
|
||||||
|
|
||||||
#: rfc2131.c:964 rfc3315.c:556
|
#: rfc2131.c:964
|
||||||
|
#: rfc3315.c:556
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "not using configured address %s because it is leased to %s"
|
msgid "not using configured address %s because it is leased to %s"
|
||||||
msgstr "benutze konfigurierte Adresse %s nicht, weil sie an %s verleast ist"
|
msgstr "benutze konfigurierte Adresse %s nicht, weil sie an %s verleast ist"
|
||||||
@@ -1396,39 +1409,41 @@ msgstr "benutze konfigurierte Adresse %s nicht, weil sie an %s verleast ist"
|
|||||||
msgid "not using configured address %s because it is in use by the server or relay"
|
msgid "not using configured address %s because it is in use by the server or relay"
|
||||||
msgstr "benutze konfigurierte Adresse %s nicht, weil sie von Server/Relais verwendet wird"
|
msgstr "benutze konfigurierte Adresse %s nicht, weil sie von Server/Relais verwendet wird"
|
||||||
|
|
||||||
#: rfc2131.c:977 rfc3315.c:560
|
#: rfc2131.c:977
|
||||||
|
#: rfc3315.c:560
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "not using configured address %s because it was previously declined"
|
msgid "not using configured address %s because it was previously declined"
|
||||||
msgstr "benutze konfigurierte Adresse %s nicht, weil sie zuvor abgelehnt wurde"
|
msgstr "benutze konfigurierte Adresse %s nicht, weil sie zuvor abgelehnt wurde"
|
||||||
|
|
||||||
# FIXME: do not assemble
|
# FIXME: do not assemble
|
||||||
#: rfc2131.c:993 rfc2131.c:1185
|
#: rfc2131.c:993
|
||||||
|
#: rfc2131.c:1185
|
||||||
msgid "no unique-id"
|
msgid "no unique-id"
|
||||||
msgstr ""
|
msgstr "Keine eindeutige ID"
|
||||||
|
|
||||||
#: rfc2131.c:1080
|
#: rfc2131.c:1080
|
||||||
msgid "wrong server-ID"
|
msgid "wrong server-ID"
|
||||||
msgstr ""
|
msgstr "Falsche Server-ID"
|
||||||
|
|
||||||
#: rfc2131.c:1099
|
#: rfc2131.c:1099
|
||||||
msgid "wrong address"
|
msgid "wrong address"
|
||||||
msgstr ""
|
msgstr "Falsche Adresse"
|
||||||
|
|
||||||
#: rfc2131.c:1117
|
#: rfc2131.c:1117
|
||||||
msgid "lease not found"
|
msgid "lease not found"
|
||||||
msgstr ""
|
msgstr "Lease nicht gefunden"
|
||||||
|
|
||||||
#: rfc2131.c:1150
|
#: rfc2131.c:1150
|
||||||
msgid "address not available"
|
msgid "address not available"
|
||||||
msgstr ""
|
msgstr "Adresse nicht verfügbar"
|
||||||
|
|
||||||
#: rfc2131.c:1161
|
#: rfc2131.c:1161
|
||||||
msgid "static lease available"
|
msgid "static lease available"
|
||||||
msgstr ""
|
msgstr "Statischer Lease verfügbar"
|
||||||
|
|
||||||
#: rfc2131.c:1165
|
#: rfc2131.c:1165
|
||||||
msgid "address reserved"
|
msgid "address reserved"
|
||||||
msgstr ""
|
msgstr "Adresse reserviert"
|
||||||
|
|
||||||
#: rfc2131.c:1173
|
#: rfc2131.c:1173
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1464,7 +1479,8 @@ msgstr "kann DHCP/BOOTP-Opition %d nicht setzen: kein Platz mehr im Paket"
|
|||||||
msgid "PXE menu too large"
|
msgid "PXE menu too large"
|
||||||
msgstr "PXE-Menüeintrag zu groß"
|
msgstr "PXE-Menüeintrag zu groß"
|
||||||
|
|
||||||
#: rfc2131.c:2117 rfc3315.c:1294
|
#: rfc2131.c:2117
|
||||||
|
#: rfc3315.c:1294
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%u requested options: %s"
|
msgid "%u requested options: %s"
|
||||||
msgstr "%u angeforderte Optionen: %s"
|
msgstr "%u angeforderte Optionen: %s"
|
||||||
@@ -1508,7 +1524,7 @@ msgstr "DHCP-Anfrage für nicht unterstützen Hardwaretyp (%d) auf %s empfangen"
|
|||||||
|
|
||||||
#: helper.c:140
|
#: helper.c:140
|
||||||
msgid "lease() function missing in Lua script"
|
msgid "lease() function missing in Lua script"
|
||||||
msgstr ""
|
msgstr "Die Funktion lease() fehlt im Lua-Script"
|
||||||
|
|
||||||
#: tftp.c:285
|
#: tftp.c:285
|
||||||
msgid "unable to get free port for TFTP"
|
msgid "unable to get free port for TFTP"
|
||||||
@@ -1556,37 +1572,37 @@ msgstr "Start fehlgeschlagen"
|
|||||||
#: conntrack.c:65
|
#: conntrack.c:65
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Conntrack connection mark retrieval failed: %s"
|
msgid "Conntrack connection mark retrieval failed: %s"
|
||||||
msgstr ""
|
msgstr "\"Conntrack connection mark\"-Abruf fehlgeschlagen: %s"
|
||||||
|
|
||||||
#: dhcp6.c:46
|
#: dhcp6.c:46
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "cannot create DHCPv6 socket: %s"
|
msgid "cannot create DHCPv6 socket: %s"
|
||||||
msgstr "kann DHCP-Socket nicht erzeugen: %s"
|
msgstr "Kann DHCPv6-Socket nicht erzeugen: %s"
|
||||||
|
|
||||||
#: dhcp6.c:57
|
#: dhcp6.c:57
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "failed to bind DHCPv6 server socket: %s"
|
msgid "failed to bind DHCPv6 server socket: %s"
|
||||||
msgstr "kann nicht an DHCP-Server-Socket binden: %s"
|
msgstr "Kann nicht an DHCPv6-Server-Socket binden: %s"
|
||||||
|
|
||||||
#: rfc3315.c:94
|
#: rfc3315.c:94
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "no address range available for DHCPv6 request from relay at %s"
|
msgid "no address range available for DHCPv6 request from relay at %s"
|
||||||
msgstr ""
|
msgstr "Kein Adressbereich verfügbar für die DHCPv6-Anfrage vom Relay bei %s"
|
||||||
|
|
||||||
#: rfc3315.c:103
|
#: rfc3315.c:103
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "no address range available for DHCPv6 request via %s"
|
msgid "no address range available for DHCPv6 request via %s"
|
||||||
msgstr ""
|
msgstr "Kein Adressbereich verfügbar für die DHCPv6-Anfrage via %s"
|
||||||
|
|
||||||
#: rfc3315.c:206
|
#: rfc3315.c:206
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "%u available DHCPv6 subnet: %s/%d"
|
msgid "%u available DHCPv6 subnet: %s/%d"
|
||||||
msgstr "%u verfügbare(s) DHCP-Subnetz: %s/%s"
|
msgstr "%u verfügbare(s) DHCPv6-Subnetz: %s/%d"
|
||||||
|
|
||||||
#: dhcp-common.c:138
|
#: dhcp-common.c:138
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Ignoring duplicate dhcp-option %d"
|
msgid "Ignoring duplicate dhcp-option %d"
|
||||||
msgstr ""
|
msgstr "Ignoriere doppelt vorhandene DHCP-Option %d"
|
||||||
|
|
||||||
#: dhcp-common.c:208
|
#: dhcp-common.c:208
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -1614,14 +1630,14 @@ msgid "duplicate IP address %s (%s) in dhcp-config directive"
|
|||||||
msgstr "doppelte IP-Adresse %s (%s) in \"dhcp-config\"-Anweisung"
|
msgstr "doppelte IP-Adresse %s (%s) in \"dhcp-config\"-Anweisung"
|
||||||
|
|
||||||
#: dhcp-common.c:443
|
#: dhcp-common.c:443
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "failed to join DHCPv6 multicast group: %s"
|
msgid "failed to join DHCPv6 multicast group: %s"
|
||||||
msgstr "kann nicht an DHCP-Server-Socket binden: %s"
|
msgstr "Konnte DHCPv6-Multicast-Gruppe nicht beitreten: %s"
|
||||||
|
|
||||||
#: radv.c:76
|
#: radv.c:76
|
||||||
#, fuzzy, c-format
|
#, c-format
|
||||||
msgid "cannot create ICMPv6 socket: %s"
|
msgid "cannot create ICMPv6 socket: %s"
|
||||||
msgstr "kann DHCP-Socket nicht erzeugen: %s"
|
msgstr "Kann ICMPv6-Socket nicht erzeugen: %s"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
#~ msgid "Specify path to Lua script (no default)."
|
#~ msgid "Specify path to Lua script (no default)."
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
|
|
||||||
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__)
|
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__)
|
||||||
|
#include <sys/param.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <net/route.h>
|
#include <net/route.h>
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
|
|||||||
+135
-49
@@ -25,6 +25,9 @@ static int cache_inserted = 0, cache_live_freed = 0, insert_error;
|
|||||||
static union bigname *big_free = NULL;
|
static union bigname *big_free = NULL;
|
||||||
static int bignames_left, hash_size;
|
static int bignames_left, hash_size;
|
||||||
static int uid = 0;
|
static int uid = 0;
|
||||||
|
#ifdef HAVE_DNSSEC
|
||||||
|
static struct keydata *keyblock_free = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* type->string mapping: this is also used by the name-hash function as a mixing table. */
|
/* type->string mapping: this is also used by the name-hash function as a mixing table. */
|
||||||
static const struct {
|
static const struct {
|
||||||
@@ -190,6 +193,10 @@ static void cache_free(struct crec *crecp)
|
|||||||
big_free = crecp->name.bname;
|
big_free = crecp->name.bname;
|
||||||
crecp->flags &= ~F_BIGNAME;
|
crecp->flags &= ~F_BIGNAME;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_DNSSEC
|
||||||
|
else if (crecp->flags & (F_DNSKEY | F_DS))
|
||||||
|
keydata_free(crecp->addr.key.keydata);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* insert a new cache entry at the head of the list (youngest entry) */
|
/* insert a new cache entry at the head of the list (youngest entry) */
|
||||||
@@ -233,7 +240,11 @@ static int is_outdated_cname_pointer(struct crec *crecp)
|
|||||||
if (!(crecp->flags & F_CNAME))
|
if (!(crecp->flags & F_CNAME))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (crecp->addr.cname.cache && crecp->addr.cname.uid == crecp->addr.cname.cache->uid)
|
/* NB. record may be reused as DS or DNSKEY, where uid is
|
||||||
|
overloaded for something completely different */
|
||||||
|
if (crecp->addr.cname.cache &&
|
||||||
|
(crecp->addr.cname.cache->flags & (F_IPV4 | F_IPV6 | F_CNAME)) &&
|
||||||
|
crecp->addr.cname.uid == crecp->addr.cname.cache->uid)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@@ -280,7 +291,7 @@ static int cache_scan_free(char *name, struct all_addr *addr, time_t now, unsign
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((crecp->flags & F_FORWARD) &&
|
else if ((crecp->flags & F_FORWARD) &&
|
||||||
((flags & crecp->flags & (F_IPV4 | F_IPV6)) || ((crecp->flags | flags) & F_CNAME)) &&
|
((flags & crecp->flags & F_TYPE) || ((crecp->flags | flags) & F_CNAME)) &&
|
||||||
hostname_isequal(cache_get_name(crecp), name))
|
hostname_isequal(cache_get_name(crecp), name))
|
||||||
{
|
{
|
||||||
if (crecp->flags & (F_HOSTS | F_DHCP))
|
if (crecp->flags & (F_HOSTS | F_DHCP))
|
||||||
@@ -360,7 +371,9 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
|
|||||||
int freed_all = flags & F_REVERSE;
|
int freed_all = flags & F_REVERSE;
|
||||||
int free_avail = 0;
|
int free_avail = 0;
|
||||||
|
|
||||||
log_query(flags | F_UPSTREAM, name, addr, NULL);
|
/* Don't log keys */
|
||||||
|
if (flags & (F_IPV4 | F_IPV6))
|
||||||
|
log_query(flags | F_UPSTREAM, name, addr, NULL);
|
||||||
|
|
||||||
/* if previous insertion failed give up now. */
|
/* if previous insertion failed give up now. */
|
||||||
if (insert_error)
|
if (insert_error)
|
||||||
@@ -452,9 +465,7 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
|
|||||||
|
|
||||||
if (addr)
|
if (addr)
|
||||||
new->addr.addr = *addr;
|
new->addr.addr = *addr;
|
||||||
else
|
|
||||||
new->addr.cname.cache = NULL;
|
|
||||||
|
|
||||||
new->ttd = now + (time_t)ttl;
|
new->ttd = now + (time_t)ttl;
|
||||||
new->next = new_chain;
|
new->next = new_chain;
|
||||||
new_chain = new;
|
new_chain = new;
|
||||||
@@ -634,13 +645,29 @@ struct crec *cache_find_by_addr(struct crec *crecp, struct all_addr *addr,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void add_hosts_cname(struct crec *target)
|
||||||
|
{
|
||||||
|
struct crec *crec;
|
||||||
|
struct cname *a;
|
||||||
|
|
||||||
|
for (a = daemon->cnames; a; a = a->next)
|
||||||
|
if (hostname_isequal(cache_get_name(target), a->target) &&
|
||||||
|
(crec = whine_malloc(sizeof(struct crec))))
|
||||||
|
{
|
||||||
|
crec->flags = F_FORWARD | F_IMMORTAL | F_NAMEP | F_HOSTS | F_CNAME;
|
||||||
|
crec->name.namep = a->alias;
|
||||||
|
crec->addr.cname.cache = target;
|
||||||
|
crec->addr.cname.uid = target->uid;
|
||||||
|
cache_hash(crec);
|
||||||
|
add_hosts_cname(crec); /* handle chains */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void add_hosts_entry(struct crec *cache, struct all_addr *addr, int addrlen,
|
static void add_hosts_entry(struct crec *cache, struct all_addr *addr, int addrlen,
|
||||||
int index, struct crec **rhash, int hashsz)
|
int index, struct crec **rhash, int hashsz)
|
||||||
{
|
{
|
||||||
struct crec *lookup = cache_find_by_name(NULL, cache_get_name(cache), 0, cache->flags & (F_IPV4 | F_IPV6));
|
struct crec *lookup = cache_find_by_name(NULL, cache_get_name(cache), 0, cache->flags & (F_IPV4 | F_IPV6));
|
||||||
int i, nameexists = 0;
|
int i, nameexists = 0;
|
||||||
struct cname *a;
|
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
|
||||||
/* Remove duplicates in hosts files. */
|
/* Remove duplicates in hosts files. */
|
||||||
@@ -691,16 +718,7 @@ static void add_hosts_entry(struct crec *cache, struct all_addr *addr, int addrl
|
|||||||
|
|
||||||
/* don't need to do alias stuff for second and subsequent addresses. */
|
/* don't need to do alias stuff for second and subsequent addresses. */
|
||||||
if (!nameexists)
|
if (!nameexists)
|
||||||
for (a = daemon->cnames; a; a = a->next)
|
add_hosts_cname(cache);
|
||||||
if (hostname_isequal(cache_get_name(cache), a->target) &&
|
|
||||||
(lookup = whine_malloc(sizeof(struct crec))))
|
|
||||||
{
|
|
||||||
lookup->flags = F_FORWARD | F_IMMORTAL | F_NAMEP | F_HOSTS | F_CNAME;
|
|
||||||
lookup->name.namep = a->alias;
|
|
||||||
lookup->addr.cname.cache = cache;
|
|
||||||
lookup->addr.cname.uid = index;
|
|
||||||
cache_hash(lookup);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int eatspace(FILE *f)
|
static int eatspace(FILE *f)
|
||||||
@@ -992,13 +1010,41 @@ void cache_unhash_dhcp(void)
|
|||||||
up = &cache->hash_next;
|
up = &cache->hash_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void add_dhcp_cname(struct crec *target, time_t ttd)
|
||||||
|
{
|
||||||
|
struct crec *aliasc;
|
||||||
|
struct cname *a;
|
||||||
|
|
||||||
|
for (a = daemon->cnames; a; a = a->next)
|
||||||
|
if (hostname_isequal(cache_get_name(target), a->target))
|
||||||
|
{
|
||||||
|
if ((aliasc = dhcp_spare))
|
||||||
|
dhcp_spare = dhcp_spare->next;
|
||||||
|
else /* need new one */
|
||||||
|
aliasc = whine_malloc(sizeof(struct crec));
|
||||||
|
|
||||||
|
if (aliasc)
|
||||||
|
{
|
||||||
|
aliasc->flags = F_FORWARD | F_NAMEP | F_DHCP | F_CNAME;
|
||||||
|
if (ttd == 0)
|
||||||
|
aliasc->flags |= F_IMMORTAL;
|
||||||
|
else
|
||||||
|
aliasc->ttd = ttd;
|
||||||
|
aliasc->name.namep = a->alias;
|
||||||
|
aliasc->addr.cname.cache = target;
|
||||||
|
aliasc->addr.cname.uid = target->uid;
|
||||||
|
cache_hash(aliasc);
|
||||||
|
add_dhcp_cname(aliasc, ttd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cache_add_dhcp_entry(char *host_name, int prot,
|
void cache_add_dhcp_entry(char *host_name, int prot,
|
||||||
struct all_addr *host_address, time_t ttd)
|
struct all_addr *host_address, time_t ttd)
|
||||||
{
|
{
|
||||||
struct crec *crec = NULL, *aliasc;
|
struct crec *crec = NULL;
|
||||||
unsigned short flags = F_IPV4;
|
unsigned short flags = F_IPV4;
|
||||||
int in_hosts = 0;
|
int in_hosts = 0;
|
||||||
struct cname *a;
|
|
||||||
size_t addrlen = sizeof(struct in_addr);
|
size_t addrlen = sizeof(struct in_addr);
|
||||||
|
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
@@ -1019,7 +1065,6 @@ void cache_add_dhcp_entry(char *host_name, int prot,
|
|||||||
|
|
||||||
inet_ntop(prot, host_address, daemon->addrbuff, ADDRSTRLEN);
|
inet_ntop(prot, host_address, daemon->addrbuff, ADDRSTRLEN);
|
||||||
if (crec->flags & F_CNAME)
|
if (crec->flags & F_CNAME)
|
||||||
|
|
||||||
my_syslog(MS_DHCP | LOG_WARNING,
|
my_syslog(MS_DHCP | LOG_WARNING,
|
||||||
_("%s is a CNAME, not giving it to the DHCP lease of %s"),
|
_("%s is a CNAME, not giving it to the DHCP lease of %s"),
|
||||||
host_name, daemon->addrbuff);
|
host_name, daemon->addrbuff);
|
||||||
@@ -1072,27 +1117,7 @@ void cache_add_dhcp_entry(char *host_name, int prot,
|
|||||||
crec->uid = uid++;
|
crec->uid = uid++;
|
||||||
cache_hash(crec);
|
cache_hash(crec);
|
||||||
|
|
||||||
for (a = daemon->cnames; a; a = a->next)
|
add_dhcp_cname(crec, ttd);
|
||||||
if (hostname_isequal(host_name, a->target))
|
|
||||||
{
|
|
||||||
if ((aliasc = dhcp_spare))
|
|
||||||
dhcp_spare = dhcp_spare->next;
|
|
||||||
else /* need new one */
|
|
||||||
aliasc = whine_malloc(sizeof(struct crec));
|
|
||||||
|
|
||||||
if (aliasc)
|
|
||||||
{
|
|
||||||
aliasc->flags = F_FORWARD | F_NAMEP | F_DHCP | F_CNAME;
|
|
||||||
if (ttd == 0)
|
|
||||||
aliasc->flags |= F_IMMORTAL;
|
|
||||||
else
|
|
||||||
aliasc->ttd = ttd;
|
|
||||||
aliasc->name.namep = a->alias;
|
|
||||||
aliasc->addr.cname.cache = crec;
|
|
||||||
aliasc->addr.cname.uid = crec->uid;
|
|
||||||
cache_hash(aliasc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1150,22 +1175,35 @@ void dump_cache(time_t now)
|
|||||||
if (!is_outdated_cname_pointer(cache))
|
if (!is_outdated_cname_pointer(cache))
|
||||||
a = cache_get_name(cache->addr.cname.cache);
|
a = cache_get_name(cache->addr.cname.cache);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_DNSSEC
|
||||||
|
else if (cache->flags & F_DNSKEY)
|
||||||
|
{
|
||||||
|
a = daemon->addrbuff;
|
||||||
|
sprintf(a, "%3u %u", cache->addr.key.algo, cache->uid);
|
||||||
|
}
|
||||||
|
else if (cache->flags & F_DS)
|
||||||
|
{
|
||||||
|
a = daemon->addrbuff;
|
||||||
|
sprintf(a, "%5u %3u %3u %u", cache->addr.key.flags_or_keyid,
|
||||||
|
cache->addr.key.algo, cache->addr.key.digest, cache->uid);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
a = daemon->addrbuff;
|
a = daemon->addrbuff;
|
||||||
if (cache->flags & F_IPV4)
|
if (cache->flags & F_IPV4)
|
||||||
inet_ntop(AF_INET, &cache->addr.addr, a, ADDRSTRLEN);
|
inet_ntop(AF_INET, &cache->addr.addr, a, ADDRSTRLEN);
|
||||||
|
#ifdef HAVE_IPV6
|
||||||
else if (cache->flags & F_IPV6)
|
else if (cache->flags & F_IPV6)
|
||||||
inet_ntop(AF_INET6, &cache->addr.addr, a, ADDRSTRLEN);
|
inet_ntop(AF_INET6, &cache->addr.addr, a, ADDRSTRLEN);
|
||||||
}
|
|
||||||
#else
|
|
||||||
else
|
|
||||||
a = inet_ntoa(cache->addr.addr.addr.addr4);
|
|
||||||
#endif
|
#endif
|
||||||
p += sprintf(p, "%-30.30s %s%s%s%s%s%s%s%s%s%s ", a,
|
}
|
||||||
|
|
||||||
|
p += sprintf(p, "%-30.30s %s%s%s%s%s%s%s%s%s%s%s%s%s ", a,
|
||||||
cache->flags & F_IPV4 ? "4" : "",
|
cache->flags & F_IPV4 ? "4" : "",
|
||||||
cache->flags & F_IPV6 ? "6" : "",
|
cache->flags & F_IPV6 ? "6" : "",
|
||||||
|
cache->flags & F_DNSKEY ? "K" : "",
|
||||||
|
cache->flags & F_DS ? "S" : "",
|
||||||
cache->flags & F_CNAME ? "C" : "",
|
cache->flags & F_CNAME ? "C" : "",
|
||||||
cache->flags & F_FORWARD ? "F" : " ",
|
cache->flags & F_FORWARD ? "F" : " ",
|
||||||
cache->flags & F_REVERSE ? "R" : " ",
|
cache->flags & F_REVERSE ? "R" : " ",
|
||||||
@@ -1173,7 +1211,8 @@ void dump_cache(time_t now)
|
|||||||
cache->flags & F_DHCP ? "D" : " ",
|
cache->flags & F_DHCP ? "D" : " ",
|
||||||
cache->flags & F_NEG ? "N" : " ",
|
cache->flags & F_NEG ? "N" : " ",
|
||||||
cache->flags & F_NXDOMAIN ? "X" : " ",
|
cache->flags & F_NXDOMAIN ? "X" : " ",
|
||||||
cache->flags & F_HOSTS ? "H" : " ");
|
cache->flags & F_HOSTS ? "H" : " ",
|
||||||
|
cache->flags & F_DNSSECOK ? "V" : " ");
|
||||||
#ifdef HAVE_BROKEN_RTC
|
#ifdef HAVE_BROKEN_RTC
|
||||||
p += sprintf(p, "%lu", cache->flags & F_IMMORTAL ? 0: (unsigned long)(cache->ttd - now));
|
p += sprintf(p, "%lu", cache->flags & F_IMMORTAL ? 0: (unsigned long)(cache->ttd - now));
|
||||||
#else
|
#else
|
||||||
@@ -1287,3 +1326,50 @@ void log_query(unsigned int flags, char *name, struct all_addr *addr, char *arg)
|
|||||||
my_syslog(LOG_INFO, "%s %s %s %s", source, name, verb, dest);
|
my_syslog(LOG_INFO, "%s %s %s %s", source, name, verb, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_DNSSEC
|
||||||
|
struct keydata *keydata_alloc(char *data, size_t len)
|
||||||
|
{
|
||||||
|
struct keydata *block, *ret = NULL;
|
||||||
|
struct keydata **prev = &ret;
|
||||||
|
while (len > 0)
|
||||||
|
{
|
||||||
|
if (keyblock_free)
|
||||||
|
{
|
||||||
|
block = keyblock_free;
|
||||||
|
keyblock_free = block->next;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
block = whine_malloc(sizeof(struct keydata));
|
||||||
|
|
||||||
|
if (!block)
|
||||||
|
{
|
||||||
|
/* failed to alloc, free partial chain */
|
||||||
|
keydata_free(ret);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(block->key, data, len > KEYBLOCK_LEN ? KEYBLOCK_LEN : len);
|
||||||
|
data += KEYBLOCK_LEN;
|
||||||
|
len -= KEYBLOCK_LEN;
|
||||||
|
*prev = block;
|
||||||
|
prev = &block->next;
|
||||||
|
block->next = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void keydata_free(struct keydata *blocks)
|
||||||
|
{
|
||||||
|
struct keydata *tmp;
|
||||||
|
|
||||||
|
if (blocks)
|
||||||
|
{
|
||||||
|
for (tmp = blocks; tmp->next; tmp = tmp->next);
|
||||||
|
tmp->next = keyblock_free;
|
||||||
|
keyblock_free = blocks;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
+9
-3
@@ -18,6 +18,7 @@
|
|||||||
#define MAX_PROCS 20 /* max no children for TCP requests */
|
#define MAX_PROCS 20 /* max no children for TCP requests */
|
||||||
#define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */
|
#define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */
|
||||||
#define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */
|
#define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */
|
||||||
|
#define KEYBLOCK_LEN 140 /* choose to mininise fragmentation when storing DNSSEC keys */
|
||||||
#define TIMEOUT 10 /* drop UDP queries after TIMEOUT seconds */
|
#define TIMEOUT 10 /* drop UDP queries after TIMEOUT seconds */
|
||||||
#define FORWARD_TEST 50 /* try all servers every 50 queries */
|
#define FORWARD_TEST 50 /* try all servers every 50 queries */
|
||||||
#define FORWARD_TIME 20 /* or 20 seconds */
|
#define FORWARD_TIME 20 /* or 20 seconds */
|
||||||
@@ -32,7 +33,6 @@
|
|||||||
#define SMALLDNAME 40 /* most domain names are smaller than this */
|
#define SMALLDNAME 40 /* most domain names are smaller than this */
|
||||||
#define HOSTSFILE "/etc/hosts"
|
#define HOSTSFILE "/etc/hosts"
|
||||||
#define ETHERSFILE "/etc/ethers"
|
#define ETHERSFILE "/etc/ethers"
|
||||||
#define RUNFILE "/var/run/dnsmasq.pid"
|
|
||||||
#define DEFLEASE 3600 /* default lease time, 1 hour */
|
#define DEFLEASE 3600 /* default lease time, 1 hour */
|
||||||
#define CHUSER "nobody"
|
#define CHUSER "nobody"
|
||||||
#define CHGRP "dip"
|
#define CHGRP "dip"
|
||||||
@@ -157,7 +157,13 @@ RESOLVFILE
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef RUNFILE
|
||||||
|
# if defined(__ANDROID__)
|
||||||
|
# define RUNFILE "/data/dnsmasq.pid"
|
||||||
|
# else
|
||||||
|
# define RUNFILE "/var/run/dnsmasq.pid"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* platform dependent options: these are determined automatically below
|
/* platform dependent options: these are determined automatically below
|
||||||
|
|
||||||
@@ -167,7 +173,7 @@ HAVE_SOLARIS_NETWORK
|
|||||||
define exactly one of these to alter interaction with kernel networking.
|
define exactly one of these to alter interaction with kernel networking.
|
||||||
|
|
||||||
HAVE_GETOPT_LONG
|
HAVE_GETOPT_LONG
|
||||||
defined when GNU-sty;e getopt_long available.
|
defined when GNU-style getopt_long available.
|
||||||
|
|
||||||
HAVE_ARC4RANDOM
|
HAVE_ARC4RANDOM
|
||||||
defined if arc4random() available to get better security from DNS spoofs
|
defined if arc4random() available to get better security from DNS spoofs
|
||||||
|
|||||||
+51
-48
@@ -111,6 +111,13 @@ struct dhcp_netid *option_filter(struct dhcp_netid *tags, struct dhcp_netid *con
|
|||||||
last_tag->next = tags;
|
last_tag->next = tags;
|
||||||
tagif = run_tag_if(context_tags);
|
tagif = run_tag_if(context_tags);
|
||||||
|
|
||||||
|
/* reset stuff with tag:!<tag> which now matches. */
|
||||||
|
for (opt = opts; opt; opt = opt->next)
|
||||||
|
if (!(opt->flags & (DHOPT_ENCAPSULATE | DHOPT_VENDOR | DHOPT_RFC3925)) &&
|
||||||
|
(opt->flags & DHOPT_TAGOK) &&
|
||||||
|
!match_netid(opt->netid, tagif, 0))
|
||||||
|
opt->flags &= ~DHOPT_TAGOK;
|
||||||
|
|
||||||
for (opt = opts; opt; opt = opt->next)
|
for (opt = opts; opt; opt = opt->next)
|
||||||
if (!(opt->flags & (DHOPT_ENCAPSULATE | DHOPT_VENDOR | DHOPT_RFC3925 | DHOPT_TAGOK)) &&
|
if (!(opt->flags & (DHOPT_ENCAPSULATE | DHOPT_VENDOR | DHOPT_RFC3925 | DHOPT_TAGOK)) &&
|
||||||
match_netid(opt->netid, tagif, 0))
|
match_netid(opt->netid, tagif, 0))
|
||||||
@@ -239,40 +246,6 @@ int match_bytes(struct dhcp_opt *o, unsigned char *p, int len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_dhcp_hosts(int fatal)
|
|
||||||
{
|
|
||||||
/* If the same IP appears in more than one host config, then DISCOVER
|
|
||||||
for one of the hosts will get the address, but REQUEST will be NAKed,
|
|
||||||
since the address is reserved by the other one -> protocol loop.
|
|
||||||
Also check that FQDNs match the domain we are using. */
|
|
||||||
|
|
||||||
struct dhcp_config *configs, *cp;
|
|
||||||
|
|
||||||
for (configs = daemon->dhcp_conf; configs; configs = configs->next)
|
|
||||||
{
|
|
||||||
char *domain;
|
|
||||||
|
|
||||||
if ((configs->flags & DHOPT_BANK) || fatal)
|
|
||||||
{
|
|
||||||
for (cp = configs->next; cp; cp = cp->next)
|
|
||||||
if ((configs->flags & cp->flags & CONFIG_ADDR) && configs->addr.s_addr == cp->addr.s_addr)
|
|
||||||
{
|
|
||||||
if (fatal)
|
|
||||||
die(_("duplicate IP address %s in dhcp-config directive."),
|
|
||||||
inet_ntoa(cp->addr), EC_BADCONF);
|
|
||||||
else
|
|
||||||
my_syslog(MS_DHCP | LOG_ERR, _("duplicate IP address %s in %s."),
|
|
||||||
inet_ntoa(cp->addr), daemon->dhcp_hosts_file);
|
|
||||||
configs->flags &= ~CONFIG_ADDR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* split off domain part */
|
|
||||||
if ((configs->flags & CONFIG_NAME) && (domain = strip_hostname(configs->hostname)))
|
|
||||||
configs->domain = domain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void dhcp_update_configs(struct dhcp_config *configs)
|
void dhcp_update_configs(struct dhcp_config *configs)
|
||||||
{
|
{
|
||||||
/* Some people like to keep all static IP addresses in /etc/hosts.
|
/* Some people like to keep all static IP addresses in /etc/hosts.
|
||||||
@@ -365,7 +338,6 @@ static int join_multicast_worker(struct in6_addr *local, int prefix,
|
|||||||
char ifrn_name[IFNAMSIZ];
|
char ifrn_name[IFNAMSIZ];
|
||||||
struct ipv6_mreq mreq;
|
struct ipv6_mreq mreq;
|
||||||
int fd, i, max = *((int *)vparam);
|
int fd, i, max = *((int *)vparam);
|
||||||
struct dhcp_context *context;
|
|
||||||
struct iname *tmp;
|
struct iname *tmp;
|
||||||
|
|
||||||
(void)prefix;
|
(void)prefix;
|
||||||
@@ -399,14 +371,6 @@ static int join_multicast_worker(struct in6_addr *local, int prefix,
|
|||||||
if (tmp->name && (strcmp(tmp->name, ifrn_name) == 0))
|
if (tmp->name && (strcmp(tmp->name, ifrn_name) == 0))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* weird libvirt-inspired access control */
|
|
||||||
for (context = daemon->dhcp6; context; context = context->next)
|
|
||||||
if (!context->interface || strcmp(context->interface, ifrn_name) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!context)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
mreq.ipv6mr_interface = if_index;
|
mreq.ipv6mr_interface = if_index;
|
||||||
|
|
||||||
inet_pton(AF_INET6, ALL_RELAY_AGENTS_AND_SERVERS, &mreq.ipv6mr_multiaddr);
|
inet_pton(AF_INET6, ALL_RELAY_AGENTS_AND_SERVERS, &mreq.ipv6mr_multiaddr);
|
||||||
@@ -444,6 +408,41 @@ void join_multicast(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LINUX_NETWORK
|
||||||
|
void bindtodevice(int fd)
|
||||||
|
{
|
||||||
|
/* If we are doing DHCP on exactly one interface, and running linux, do SO_BINDTODEVICE
|
||||||
|
to that device. This is for the use case of (eg) OpenStack, which runs a new
|
||||||
|
dnsmasq instance for each VLAN interface it creates. Without the BINDTODEVICE,
|
||||||
|
individual processes don't always see the packets they should.
|
||||||
|
SO_BINDTODEVICE is only available Linux. */
|
||||||
|
|
||||||
|
struct irec *iface, *found;
|
||||||
|
|
||||||
|
for (found = NULL, iface = daemon->interfaces; iface; iface = iface->next)
|
||||||
|
if (iface->dhcp_ok)
|
||||||
|
{
|
||||||
|
if (!found)
|
||||||
|
found = iface;
|
||||||
|
else if (strcmp(found->name, iface->name) != 0)
|
||||||
|
{
|
||||||
|
/* more than one. */
|
||||||
|
found = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
struct ifreq ifr;
|
||||||
|
strcpy(ifr.ifr_name, found->name);
|
||||||
|
/* only allowed by root. */
|
||||||
|
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) == -1 &&
|
||||||
|
errno != EPERM)
|
||||||
|
die(_("failed to set SO_BINDTODEVICE on DHCP socket: %s"), NULL, EC_BADNET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const struct opttab_t {
|
static const struct opttab_t {
|
||||||
char *name;
|
char *name;
|
||||||
@@ -488,15 +487,15 @@ static const struct opttab_t {
|
|||||||
{ "x-windows-fs", 48, OT_ADDR_LIST },
|
{ "x-windows-fs", 48, OT_ADDR_LIST },
|
||||||
{ "x-windows-dm", 49, OT_ADDR_LIST },
|
{ "x-windows-dm", 49, OT_ADDR_LIST },
|
||||||
{ "requested-address", 50, OT_INTERNAL | OT_ADDR_LIST },
|
{ "requested-address", 50, OT_INTERNAL | OT_ADDR_LIST },
|
||||||
{ "lease-time", 51, OT_INTERNAL | OT_DEC },
|
{ "lease-time", 51, OT_INTERNAL | OT_TIME },
|
||||||
{ "option-overload", 52, OT_INTERNAL },
|
{ "option-overload", 52, OT_INTERNAL },
|
||||||
{ "message-type", 53, OT_INTERNAL | OT_DEC },
|
{ "message-type", 53, OT_INTERNAL | OT_DEC },
|
||||||
{ "server-identifier", 54, OT_INTERNAL | OT_ADDR_LIST },
|
{ "server-identifier", 54, OT_INTERNAL | OT_ADDR_LIST },
|
||||||
{ "parameter-request", 55, OT_INTERNAL },
|
{ "parameter-request", 55, OT_INTERNAL },
|
||||||
{ "message", 56, OT_INTERNAL },
|
{ "message", 56, OT_INTERNAL },
|
||||||
{ "max-message-size", 57, OT_INTERNAL },
|
{ "max-message-size", 57, OT_INTERNAL },
|
||||||
{ "T1", 58, OT_INTERNAL | OT_DEC},
|
{ "T1", 58, OT_INTERNAL | OT_TIME},
|
||||||
{ "T2", 59, OT_INTERNAL | OT_DEC},
|
{ "T2", 59, OT_INTERNAL | OT_TIME},
|
||||||
{ "vendor-class", 60, 0 },
|
{ "vendor-class", 60, 0 },
|
||||||
{ "client-id", 61, OT_INTERNAL },
|
{ "client-id", 61, OT_INTERNAL },
|
||||||
{ "nis+-domain", 64, OT_NAME },
|
{ "nis+-domain", 64, OT_NAME },
|
||||||
@@ -547,6 +546,7 @@ static const struct opttab_t opttab6[] = {
|
|||||||
{ "nis-domain", 29, OT_RFC1035_NAME },
|
{ "nis-domain", 29, OT_RFC1035_NAME },
|
||||||
{ "nis+-domain", 30, OT_RFC1035_NAME },
|
{ "nis+-domain", 30, OT_RFC1035_NAME },
|
||||||
{ "sntp-server", 31, OT_ADDR_LIST },
|
{ "sntp-server", 31, OT_ADDR_LIST },
|
||||||
|
{ "information-refresh-time", 32, OT_TIME },
|
||||||
{ "FQDN", 39, OT_INTERNAL | OT_RFC1035_NAME },
|
{ "FQDN", 39, OT_INTERNAL | OT_RFC1035_NAME },
|
||||||
{ "ntp-server", 56, OT_ADDR_LIST },
|
{ "ntp-server", 56, OT_ADDR_LIST },
|
||||||
{ "bootfile-url", 59, OT_NAME },
|
{ "bootfile-url", 59, OT_NAME },
|
||||||
@@ -711,14 +711,17 @@ char *option_string(int prot, unsigned int opt, unsigned char *val, int opt_len,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if ((ot[o].size & OT_DEC) && opt_len != 0)
|
else if ((ot[o].size & (OT_DEC | OT_TIME)) && opt_len != 0)
|
||||||
{
|
{
|
||||||
unsigned int dec = 0;
|
unsigned int dec = 0;
|
||||||
|
|
||||||
for (i = 0; i < opt_len; i++)
|
for (i = 0; i < opt_len; i++)
|
||||||
dec = (dec << 8) | val[i];
|
dec = (dec << 8) | val[i];
|
||||||
|
|
||||||
sprintf(buf, "%u", dec);
|
if (ot[o].size & OT_TIME)
|
||||||
|
prettyprint_time(buf, dec);
|
||||||
|
else
|
||||||
|
sprintf(buf, "%u", dec);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
nodecode = 1;
|
nodecode = 1;
|
||||||
|
|||||||
+3
-13
@@ -66,7 +66,7 @@ static int make_fd(int port)
|
|||||||
/* When bind-interfaces is set, there might be more than one dnmsasq
|
/* When bind-interfaces is set, there might be more than one dnmsasq
|
||||||
instance binding port 67. That's OK if they serve different networks.
|
instance binding port 67. That's OK if they serve different networks.
|
||||||
Need to set REUSEADDR to make this posible, or REUSEPORT on *BSD. */
|
Need to set REUSEADDR to make this posible, or REUSEPORT on *BSD. */
|
||||||
if (option_bool(OPT_NOWILD))
|
if (option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND))
|
||||||
{
|
{
|
||||||
#ifdef SO_REUSEPORT
|
#ifdef SO_REUSEPORT
|
||||||
int rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &oneopt, sizeof(oneopt));
|
int rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &oneopt, sizeof(oneopt));
|
||||||
@@ -116,9 +116,7 @@ void dhcp_init(void)
|
|||||||
|
|
||||||
/* Make BPF raw send socket */
|
/* Make BPF raw send socket */
|
||||||
init_bpf();
|
init_bpf();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
check_dhcp_hosts(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dhcp_packet(time_t now, int pxe_fd)
|
void dhcp_packet(time_t now, int pxe_fd)
|
||||||
@@ -257,14 +255,6 @@ void dhcp_packet(time_t now, int pxe_fd)
|
|||||||
if (tmp->name && (strcmp(tmp->name, ifr.ifr_name) == 0))
|
if (tmp->name && (strcmp(tmp->name, ifr.ifr_name) == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* weird libvirt-inspired access control */
|
|
||||||
for (context = daemon->dhcp; context; context = context->next)
|
|
||||||
if (!context->interface || strcmp(context->interface, ifr.ifr_name) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!context)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* unlinked contexts are marked by context->current == context */
|
/* unlinked contexts are marked by context->current == context */
|
||||||
for (context = daemon->dhcp; context; context = context->next)
|
for (context = daemon->dhcp; context; context = context->next)
|
||||||
context->current = context;
|
context->current = context;
|
||||||
@@ -277,7 +267,7 @@ void dhcp_packet(time_t now, int pxe_fd)
|
|||||||
/* If we failed to match the primary address of the interface, see if we've got a --listen-address
|
/* If we failed to match the primary address of the interface, see if we've got a --listen-address
|
||||||
for a secondary */
|
for a secondary */
|
||||||
struct match_param match;
|
struct match_param match;
|
||||||
|
|
||||||
match.matched = 0;
|
match.matched = 0;
|
||||||
match.ind = iface_index;
|
match.ind = iface_index;
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
#define OPTION6_RECONFIGURE_MSG 19
|
#define OPTION6_RECONFIGURE_MSG 19
|
||||||
#define OPTION6_RECONF_ACCEPT 20
|
#define OPTION6_RECONF_ACCEPT 20
|
||||||
#define OPTION6_DNS_SERVER 23
|
#define OPTION6_DNS_SERVER 23
|
||||||
|
#define OPTION6_DOMAIN_SEARCH 24
|
||||||
#define OPTION6_REMOTE_ID 37
|
#define OPTION6_REMOTE_ID 37
|
||||||
#define OPTION6_SUBSCRIBER_ID 38
|
#define OPTION6_SUBSCRIBER_ID 38
|
||||||
#define OPTION6_FQDN 39
|
#define OPTION6_FQDN 39
|
||||||
|
|||||||
+6
-14
@@ -33,12 +33,12 @@ void dhcp6_init(void)
|
|||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
struct sockaddr_in6 saddr;
|
struct sockaddr_in6 saddr;
|
||||||
#if defined(IP_TOS) && defined(IPTOS_CLASS_CS6)
|
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
|
||||||
int class = IPTOS_CLASS_CS6;
|
int class = IPTOS_CLASS_CS6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((fd = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP)) == -1 ||
|
if ((fd = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP)) == -1 ||
|
||||||
#if defined(IP_TOS) && defined(IPTOS_CLASS_CS6)
|
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
|
||||||
setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &class, sizeof(class)) == -1 ||
|
setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &class, sizeof(class)) == -1 ||
|
||||||
#endif
|
#endif
|
||||||
!fix_fd(fd) ||
|
!fix_fd(fd) ||
|
||||||
@@ -111,14 +111,6 @@ void dhcp6_packet(time_t now)
|
|||||||
if (tmp->name && (strcmp(tmp->name, ifr.ifr_name) == 0))
|
if (tmp->name && (strcmp(tmp->name, ifr.ifr_name) == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* weird libvirt-inspired access control */
|
|
||||||
for (context = daemon->dhcp6; context; context = context->next)
|
|
||||||
if (!context->interface || strcmp(context->interface, ifr.ifr_name) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!context)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* unlinked contexts are marked by context->current == context */
|
/* unlinked contexts are marked by context->current == context */
|
||||||
for (context = daemon->dhcp6; context; context = context->next)
|
for (context = daemon->dhcp6; context; context = context->next)
|
||||||
{
|
{
|
||||||
@@ -229,7 +221,7 @@ int address6_allocate(struct dhcp_context *context, unsigned char *clid, int cl
|
|||||||
|
|
||||||
for (pass = 0; pass <= 1; pass++)
|
for (pass = 0; pass <= 1; pass++)
|
||||||
for (c = context; c; c = c->current)
|
for (c = context; c; c = c->current)
|
||||||
if (c->flags & (CONTEXT_STATIC | CONTEXT_PROXY))
|
if (c->flags & (CONTEXT_DEPRECATE | CONTEXT_STATIC | CONTEXT_RA_STATELESS))
|
||||||
continue;
|
continue;
|
||||||
else if (!match_netid(c->filter, netids, pass))
|
else if (!match_netid(c->filter, netids, pass))
|
||||||
continue;
|
continue;
|
||||||
@@ -282,9 +274,9 @@ struct dhcp_context *address6_available(struct dhcp_context *context,
|
|||||||
start = addr6part(&tmp->start6);
|
start = addr6part(&tmp->start6);
|
||||||
end = addr6part(&tmp->end6);
|
end = addr6part(&tmp->end6);
|
||||||
|
|
||||||
if (!(tmp->flags & (CONTEXT_STATIC | CONTEXT_PROXY)) &&
|
if (!(tmp->flags & (CONTEXT_STATIC | CONTEXT_RA_STATELESS)) &&
|
||||||
is_same_net6(&context->start6, taddr, context->prefix) &&
|
is_same_net6(&tmp->start6, taddr, tmp->prefix) &&
|
||||||
is_same_net6(&context->end6, taddr, context->prefix) &&
|
is_same_net6(&tmp->end6, taddr, tmp->prefix) &&
|
||||||
addr >= start &&
|
addr >= start &&
|
||||||
addr <= end &&
|
addr <= end &&
|
||||||
match_netid(tmp->filter, netids, 1))
|
match_netid(tmp->filter, netids, 1))
|
||||||
|
|||||||
+143
-66
@@ -114,10 +114,18 @@ int main (int argc, char **argv)
|
|||||||
set_option_bool(OPT_NOWILD);
|
set_option_bool(OPT_NOWILD);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
/* -- bind-dynamic not supported on !Linux, fall back to --bind-interfaces */
|
||||||
|
if (option_bool(OPT_CLEVERBIND))
|
||||||
|
{
|
||||||
|
bind_fallback = 1;
|
||||||
|
set_option_bool(OPT_NOWILD);
|
||||||
|
reset_option_bool(OPT_CLEVERBIND);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_TFTP
|
#ifndef HAVE_TFTP
|
||||||
if (daemon->tftp_unlimited || daemon->tftp_interfaces)
|
if (option_bool(OPT_TFTP))
|
||||||
die(_("TFTP server not available: set HAVE_TFTP in src/config.h"), NULL, EC_BADCONF);
|
die(_("TFTP server not available: set HAVE_TFTP in src/config.h"), NULL, EC_BADCONF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -185,6 +193,9 @@ int main (int argc, char **argv)
|
|||||||
#ifdef HAVE_LINUX_NETWORK
|
#ifdef HAVE_LINUX_NETWORK
|
||||||
/* After lease_init */
|
/* After lease_init */
|
||||||
netlink_init();
|
netlink_init();
|
||||||
|
|
||||||
|
if (option_bool(OPT_NOWILD) && option_bool(OPT_CLEVERBIND))
|
||||||
|
die(_("cannot set --bind-interfaces and --bind-dynamic"), NULL, EC_BADCONF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
@@ -202,20 +213,29 @@ int main (int argc, char **argv)
|
|||||||
if (!enumerate_interfaces())
|
if (!enumerate_interfaces())
|
||||||
die(_("failed to find list of interfaces: %s"), NULL, EC_MISC);
|
die(_("failed to find list of interfaces: %s"), NULL, EC_MISC);
|
||||||
|
|
||||||
if (option_bool(OPT_NOWILD))
|
if (option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND))
|
||||||
{
|
{
|
||||||
create_bound_listeners(1);
|
create_bound_listeners(1);
|
||||||
|
|
||||||
|
if (!option_bool(OPT_CLEVERBIND))
|
||||||
|
for (if_tmp = daemon->if_names; if_tmp; if_tmp = if_tmp->next)
|
||||||
|
if (if_tmp->name && !if_tmp->used)
|
||||||
|
die(_("unknown interface %s"), if_tmp->name, EC_BADNET);
|
||||||
|
|
||||||
for (if_tmp = daemon->if_names; if_tmp; if_tmp = if_tmp->next)
|
#if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP)
|
||||||
if (if_tmp->name && !if_tmp->used)
|
/* after enumerate_interfaces() */
|
||||||
die(_("unknown interface %s"), if_tmp->name, EC_BADNET);
|
if (daemon->dhcp)
|
||||||
|
{
|
||||||
for (if_tmp = daemon->if_addrs; if_tmp; if_tmp = if_tmp->next)
|
bindtodevice(daemon->dhcpfd);
|
||||||
if (!if_tmp->used)
|
if (daemon->enable_pxe)
|
||||||
{
|
bindtodevice(daemon->pxefd);
|
||||||
prettyprint_addr(&if_tmp->addr, daemon->namebuff);
|
}
|
||||||
die(_("no interface with address %s"), daemon->namebuff, EC_BADNET);
|
#endif
|
||||||
}
|
|
||||||
|
#if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP6)
|
||||||
|
if (daemon->dhcp6)
|
||||||
|
bindtodevice(daemon->dhcp6fd);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
create_wildcard_listeners();
|
create_wildcard_listeners();
|
||||||
@@ -417,8 +437,9 @@ int main (int argc, char **argv)
|
|||||||
#if defined(HAVE_LINUX_NETWORK)
|
#if defined(HAVE_LINUX_NETWORK)
|
||||||
/* On linux, we keep CAP_NETADMIN (for ARP-injection) and
|
/* On linux, we keep CAP_NETADMIN (for ARP-injection) and
|
||||||
CAP_NET_RAW (for icmp) if we're doing dhcp. If we have yet to bind
|
CAP_NET_RAW (for icmp) if we're doing dhcp. If we have yet to bind
|
||||||
ports because of DAD, we need CAP_NET_BIND_SERVICE too. */
|
ports because of DAD, or we're doing it dynamically,
|
||||||
if (is_dad_listeners())
|
we need CAP_NET_BIND_SERVICE too. */
|
||||||
|
if (is_dad_listeners() || option_bool(OPT_CLEVERBIND))
|
||||||
data->effective = data->permitted = data->inheritable =
|
data->effective = data->permitted = data->inheritable =
|
||||||
(1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW) |
|
(1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW) |
|
||||||
(1 << CAP_SETUID) | (1 << CAP_NET_BIND_SERVICE);
|
(1 << CAP_SETUID) | (1 << CAP_NET_BIND_SERVICE);
|
||||||
@@ -466,7 +487,7 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_NETWORK
|
#ifdef HAVE_LINUX_NETWORK
|
||||||
if (is_dad_listeners())
|
if (is_dad_listeners() || option_bool(OPT_CLEVERBIND))
|
||||||
data->effective = data->permitted =
|
data->effective = data->permitted =
|
||||||
(1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW) | (1 << CAP_NET_BIND_SERVICE);
|
(1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW) | (1 << CAP_NET_BIND_SERVICE);
|
||||||
else
|
else
|
||||||
@@ -490,6 +511,34 @@ int main (int argc, char **argv)
|
|||||||
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
|
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_TFTP
|
||||||
|
if (option_bool(OPT_TFTP))
|
||||||
|
{
|
||||||
|
DIR *dir;
|
||||||
|
struct tftp_prefix *p;
|
||||||
|
|
||||||
|
if (daemon->tftp_prefix)
|
||||||
|
{
|
||||||
|
if (!((dir = opendir(daemon->tftp_prefix))))
|
||||||
|
{
|
||||||
|
send_event(err_pipe[1], EVENT_TFTP_ERR, errno, daemon->tftp_prefix);
|
||||||
|
_exit(0);
|
||||||
|
}
|
||||||
|
closedir(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = daemon->if_prefix; p; p = p->next)
|
||||||
|
{
|
||||||
|
if (!((dir = opendir(p->prefix))))
|
||||||
|
{
|
||||||
|
send_event(err_pipe[1], EVENT_TFTP_ERR, errno, p->prefix);
|
||||||
|
_exit(0);
|
||||||
|
}
|
||||||
|
closedir(dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (daemon->port == 0)
|
if (daemon->port == 0)
|
||||||
my_syslog(LOG_INFO, _("started, version %s DNS disabled"), VERSION);
|
my_syslog(LOG_INFO, _("started, version %s DNS disabled"), VERSION);
|
||||||
else if (daemon->cachesize != 0)
|
else if (daemon->cachesize != 0)
|
||||||
@@ -537,7 +586,7 @@ int main (int argc, char **argv)
|
|||||||
my_syslog(MS_DHCP | LOG_INFO, _("IPv6 router advertisement enabled"));
|
my_syslog(MS_DHCP | LOG_INFO, _("IPv6 router advertisement enabled"));
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
if (daemon->dhcp || daemon->dhcp6)
|
if (daemon->dhcp || daemon->dhcp6 || daemon->ra_contexts)
|
||||||
{
|
{
|
||||||
struct dhcp_context *dhcp_tmp;
|
struct dhcp_context *dhcp_tmp;
|
||||||
int family = AF_INET;
|
int family = AF_INET;
|
||||||
@@ -550,29 +599,56 @@ int main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
void *start = &dhcp_tmp->start;
|
void *start = &dhcp_tmp->start;
|
||||||
void *end = &dhcp_tmp->end;
|
void *end = &dhcp_tmp->end;
|
||||||
|
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
if (family == AF_INET6)
|
if (family == AF_INET6)
|
||||||
{
|
{
|
||||||
start = &dhcp_tmp->start6;
|
start = &dhcp_tmp->start6;
|
||||||
end = &dhcp_tmp->end6;
|
end = &dhcp_tmp->end6;
|
||||||
|
struct in6_addr subnet = dhcp_tmp->start6;
|
||||||
|
setaddr6part(&subnet, 0);
|
||||||
|
inet_ntop(AF_INET6, &subnet, daemon->addrbuff, 256);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
prettyprint_time(daemon->dhcp_buff2, dhcp_tmp->lease_time);
|
if (family != AF_INET && (dhcp_tmp->flags & CONTEXT_DEPRECATE))
|
||||||
inet_ntop(family, start, daemon->dhcp_buff, 256);
|
strcpy(daemon->namebuff, _("prefix deprecated"));
|
||||||
inet_ntop(family, end, daemon->dhcp_buff3, 256);
|
else
|
||||||
my_syslog(MS_DHCP | LOG_INFO,
|
{
|
||||||
(dhcp_tmp->flags & CONTEXT_STATIC) ?
|
char *p = daemon->namebuff;
|
||||||
_("DHCP, static leases only on %.0s%s, lease time %s") :
|
p += sprintf(p, _("lease time "));
|
||||||
(dhcp_tmp->flags & CONTEXT_RA_NAME) ?
|
prettyprint_time(p, dhcp_tmp->lease_time);
|
||||||
_("router advertisement with DHCPv4-derived names on %.0s%s, lifetime %s") :
|
}
|
||||||
(dhcp_tmp->flags & CONTEXT_RA_ONLY) ?
|
|
||||||
_("router advertisement only on %.0s%s, lifetime %s") :
|
if (daemon->dhcp_buff)
|
||||||
(dhcp_tmp->flags & CONTEXT_PROXY) ?
|
inet_ntop(family, start, daemon->dhcp_buff, 256);
|
||||||
_("DHCP, proxy on subnet %.0s%s%.0s") :
|
if (daemon->dhcp_buff3)
|
||||||
_("DHCP, IP range %s -- %s, lease time %s"),
|
inet_ntop(family, end, daemon->dhcp_buff3, 256);
|
||||||
daemon->dhcp_buff, daemon->dhcp_buff3, daemon->dhcp_buff2);
|
if ((dhcp_tmp->flags & CONTEXT_DHCP) || family == AF_INET)
|
||||||
|
my_syslog(MS_DHCP | LOG_INFO,
|
||||||
|
(dhcp_tmp->flags & CONTEXT_RA_STATELESS) ?
|
||||||
|
_("stateless DHCPv6 on %s%.0s%.0s") :
|
||||||
|
(dhcp_tmp->flags & CONTEXT_STATIC) ?
|
||||||
|
_("DHCP, static leases only on %.0s%s, %s") :
|
||||||
|
(dhcp_tmp->flags & CONTEXT_PROXY) ?
|
||||||
|
_("DHCP, proxy on subnet %.0s%s%.0s") :
|
||||||
|
_("DHCP, IP range %s -- %s, %s"),
|
||||||
|
daemon->dhcp_buff, daemon->dhcp_buff3, daemon->namebuff);
|
||||||
|
|
||||||
|
if (dhcp_tmp->flags & CONTEXT_RA_NAME)
|
||||||
|
my_syslog(MS_DHCP | LOG_INFO, _("DHCPv4-derived IPv6 names on %s"),
|
||||||
|
daemon->addrbuff);
|
||||||
|
if (dhcp_tmp->flags & (CONTEXT_RA_ONLY | CONTEXT_RA_NAME | CONTEXT_RA_STATELESS))
|
||||||
|
{
|
||||||
|
if (!(dhcp_tmp->flags & CONTEXT_DEPRECATE))
|
||||||
|
{
|
||||||
|
char *p = daemon->namebuff;
|
||||||
|
p += sprintf(p, _("prefix valid "));
|
||||||
|
prettyprint_time(p, dhcp_tmp->lease_time > 7200 ? dhcp_tmp->lease_time : 7200);
|
||||||
|
}
|
||||||
|
my_syslog(MS_DHCP | LOG_INFO, _("SLAAC on %s %s"),
|
||||||
|
daemon->addrbuff, daemon->namebuff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
@@ -592,7 +668,7 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_TFTP
|
#ifdef HAVE_TFTP
|
||||||
if (daemon->tftp_unlimited || daemon->tftp_interfaces)
|
if (option_bool(OPT_TFTP))
|
||||||
{
|
{
|
||||||
#ifdef FD_SETSIZE
|
#ifdef FD_SETSIZE
|
||||||
if (FD_SETSIZE < (unsigned)max_fd)
|
if (FD_SETSIZE < (unsigned)max_fd)
|
||||||
@@ -700,12 +776,12 @@ int main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
FD_SET(daemon->dhcp6fd, &rset);
|
FD_SET(daemon->dhcp6fd, &rset);
|
||||||
bump_maxfd(daemon->dhcp6fd, &maxfd);
|
bump_maxfd(daemon->dhcp6fd, &maxfd);
|
||||||
|
}
|
||||||
if (daemon->ra_contexts)
|
|
||||||
{
|
if (daemon->ra_contexts)
|
||||||
FD_SET(daemon->icmp6fd, &rset);
|
{
|
||||||
bump_maxfd(daemon->icmp6fd, &maxfd);
|
FD_SET(daemon->icmp6fd, &rset);
|
||||||
}
|
bump_maxfd(daemon->icmp6fd, &maxfd);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -814,14 +890,11 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
if (daemon->dhcp6)
|
if (daemon->dhcp6 && FD_ISSET(daemon->dhcp6fd, &rset))
|
||||||
{
|
dhcp6_packet(now);
|
||||||
if (FD_ISSET(daemon->dhcp6fd, &rset))
|
|
||||||
dhcp6_packet(now);
|
|
||||||
|
|
||||||
if (daemon->ra_contexts && FD_ISSET(daemon->icmp6fd, &rset))
|
if (daemon->ra_contexts && FD_ISSET(daemon->icmp6fd, &rset))
|
||||||
icmp6_packet();
|
icmp6_packet();
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# ifdef HAVE_SCRIPT
|
# ifdef HAVE_SCRIPT
|
||||||
@@ -963,6 +1036,9 @@ static void fatal_event(struct event_desc *ev, char *msg)
|
|||||||
|
|
||||||
case EVENT_LUA_ERR:
|
case EVENT_LUA_ERR:
|
||||||
die(_("failed to load Lua script: %s"), msg, EC_MISC);
|
die(_("failed to load Lua script: %s"), msg, EC_MISC);
|
||||||
|
|
||||||
|
case EVENT_TFTP_ERR:
|
||||||
|
die(_("TFTP directory %s inaccessible: %s"), msg, EC_FILE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1167,20 +1243,15 @@ void clear_cache_and_reload(time_t now)
|
|||||||
dhcp_read_ethers();
|
dhcp_read_ethers();
|
||||||
reread_dhcp();
|
reread_dhcp();
|
||||||
dhcp_update_configs(daemon->dhcp_conf);
|
dhcp_update_configs(daemon->dhcp_conf);
|
||||||
check_dhcp_hosts(0);
|
|
||||||
lease_update_from_configs();
|
lease_update_from_configs();
|
||||||
lease_update_file(now);
|
lease_update_file(now);
|
||||||
lease_update_dns(1);
|
lease_update_dns(1);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
else if (daemon->ra_contexts)
|
else if (daemon->ra_contexts)
|
||||||
{
|
/* Not doing DHCP, so no lease system, manage
|
||||||
/* Not doing DHCP, so no lease system, manage
|
alarms for ra only */
|
||||||
alarms for ra only */
|
send_alarm(periodic_ra(now), now);
|
||||||
time_t next_event = periodic_ra(now);
|
|
||||||
if (next_event != 0)
|
|
||||||
alarm((unsigned)difftime(next_event, now));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1284,18 +1355,19 @@ static void check_dns_listeners(fd_set *set, time_t now)
|
|||||||
int confd;
|
int confd;
|
||||||
struct irec *iface = NULL;
|
struct irec *iface = NULL;
|
||||||
pid_t p;
|
pid_t p;
|
||||||
|
union mysockaddr tcp_addr;
|
||||||
|
socklen_t tcp_len = sizeof(union mysockaddr);
|
||||||
|
|
||||||
|
while ((confd = accept(listener->tcpfd, NULL, NULL)) == -1 && errno == EINTR);
|
||||||
|
|
||||||
while((confd = accept(listener->tcpfd, NULL, NULL)) == -1 && errno == EINTR);
|
if (confd == -1 ||
|
||||||
|
getsockname(confd, (struct sockaddr *)&tcp_addr, &tcp_len) == -1)
|
||||||
if (confd == -1)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (option_bool(OPT_NOWILD))
|
if (option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND))
|
||||||
iface = listener->iface;
|
iface = listener->iface; /* May be NULL */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
union mysockaddr tcp_addr;
|
|
||||||
socklen_t tcp_len = sizeof(union mysockaddr);
|
|
||||||
/* Check for allowed interfaces when binding the wildcard address:
|
/* Check for allowed interfaces when binding the wildcard address:
|
||||||
we do this by looking for an interface with the same address as
|
we do this by looking for an interface with the same address as
|
||||||
the local address of the TCP connection, then looking to see if that's
|
the local address of the TCP connection, then looking to see if that's
|
||||||
@@ -1303,14 +1375,13 @@ static void check_dns_listeners(fd_set *set, time_t now)
|
|||||||
interface too, for localisation. */
|
interface too, for localisation. */
|
||||||
|
|
||||||
/* interface may be new since startup */
|
/* interface may be new since startup */
|
||||||
if (enumerate_interfaces() &&
|
if (enumerate_interfaces())
|
||||||
getsockname(confd, (struct sockaddr *)&tcp_addr, &tcp_len) != -1)
|
|
||||||
for (iface = daemon->interfaces; iface; iface = iface->next)
|
for (iface = daemon->interfaces; iface; iface = iface->next)
|
||||||
if (sockaddr_isequal(&iface->addr, &tcp_addr))
|
if (sockaddr_isequal(&iface->addr, &tcp_addr))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!iface)
|
if (!iface && !(option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND)))
|
||||||
{
|
{
|
||||||
shutdown(confd, SHUT_RDWR);
|
shutdown(confd, SHUT_RDWR);
|
||||||
close(confd);
|
close(confd);
|
||||||
@@ -1336,7 +1407,13 @@ static void check_dns_listeners(fd_set *set, time_t now)
|
|||||||
unsigned char *buff;
|
unsigned char *buff;
|
||||||
struct server *s;
|
struct server *s;
|
||||||
int flags;
|
int flags;
|
||||||
|
struct in_addr netmask;
|
||||||
|
|
||||||
|
if (iface)
|
||||||
|
netmask = iface->netmask;
|
||||||
|
else
|
||||||
|
netmask.s_addr = 0;
|
||||||
|
|
||||||
#ifndef NO_FORK
|
#ifndef NO_FORK
|
||||||
/* Arrange for SIGALARM after CHILD_LIFETIME seconds to
|
/* Arrange for SIGALARM after CHILD_LIFETIME seconds to
|
||||||
terminate the process. */
|
terminate the process. */
|
||||||
@@ -1354,7 +1431,7 @@ static void check_dns_listeners(fd_set *set, time_t now)
|
|||||||
if ((flags = fcntl(confd, F_GETFL, 0)) != -1)
|
if ((flags = fcntl(confd, F_GETFL, 0)) != -1)
|
||||||
fcntl(confd, F_SETFL, flags & ~O_NONBLOCK);
|
fcntl(confd, F_SETFL, flags & ~O_NONBLOCK);
|
||||||
|
|
||||||
buff = tcp_request(confd, now, &iface->addr, iface->netmask);
|
buff = tcp_request(confd, now, &tcp_addr, netmask);
|
||||||
|
|
||||||
shutdown(confd, SHUT_RDWR);
|
shutdown(confd, SHUT_RDWR);
|
||||||
close(confd);
|
close(confd);
|
||||||
|
|||||||
+54
-28
@@ -159,6 +159,7 @@ struct event_desc {
|
|||||||
#define EVENT_LOG_ERR 17
|
#define EVENT_LOG_ERR 17
|
||||||
#define EVENT_FORK_ERR 18
|
#define EVENT_FORK_ERR 18
|
||||||
#define EVENT_LUA_ERR 19
|
#define EVENT_LUA_ERR 19
|
||||||
|
#define EVENT_TFTP_ERR 20
|
||||||
|
|
||||||
/* Exit codes. */
|
/* Exit codes. */
|
||||||
#define EC_GOOD 0
|
#define EC_GOOD 0
|
||||||
@@ -217,7 +218,10 @@ struct event_desc {
|
|||||||
#define OPT_CONNTRACK 35
|
#define OPT_CONNTRACK 35
|
||||||
#define OPT_FQDN_UPDATE 36
|
#define OPT_FQDN_UPDATE 36
|
||||||
#define OPT_RA 37
|
#define OPT_RA 37
|
||||||
#define OPT_LAST 38
|
#define OPT_TFTP_LC 38
|
||||||
|
#define OPT_CLEVERBIND 39
|
||||||
|
#define OPT_TFTP 40
|
||||||
|
#define OPT_LAST 41
|
||||||
|
|
||||||
/* extra flags for my_syslog, we use a couple of facilities since they are known
|
/* extra flags for my_syslog, we use a couple of facilities since they are known
|
||||||
not to occupy the same bits as priorities, no matter how syslog.h is set up. */
|
not to occupy the same bits as priorities, no matter how syslog.h is set up. */
|
||||||
@@ -297,17 +301,30 @@ union bigname {
|
|||||||
union bigname *next; /* freelist */
|
union bigname *next; /* freelist */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct keydata {
|
||||||
|
struct keydata *next;
|
||||||
|
unsigned char key[KEYBLOCK_LEN];
|
||||||
|
};
|
||||||
|
|
||||||
struct crec {
|
struct crec {
|
||||||
struct crec *next, *prev, *hash_next;
|
struct crec *next, *prev, *hash_next;
|
||||||
time_t ttd; /* time to die */
|
/* union is 16 bytes when doing IPv6, 8 bytes on 32 bit machines without IPv6 */
|
||||||
int uid;
|
|
||||||
union {
|
union {
|
||||||
struct all_addr addr;
|
struct all_addr addr;
|
||||||
struct {
|
struct {
|
||||||
struct crec *cache;
|
struct crec *cache;
|
||||||
int uid;
|
int uid;
|
||||||
} cname;
|
} cname;
|
||||||
|
struct {
|
||||||
|
struct keydata *keydata;
|
||||||
|
unsigned char algo;
|
||||||
|
unsigned char digest; /* DS only */
|
||||||
|
unsigned short flags_or_keyid; /* flags for DNSKEY, keyid for DS */
|
||||||
|
} key;
|
||||||
} addr;
|
} addr;
|
||||||
|
time_t ttd; /* time to die */
|
||||||
|
/* used as keylen if F_DS or F_DNSKEY, index to source for F_HOSTS */
|
||||||
|
int uid;
|
||||||
unsigned short flags;
|
unsigned short flags;
|
||||||
union {
|
union {
|
||||||
char sname[SMALLDNAME];
|
char sname[SMALLDNAME];
|
||||||
@@ -328,14 +345,21 @@ struct crec {
|
|||||||
#define F_BIGNAME (1u<<9)
|
#define F_BIGNAME (1u<<9)
|
||||||
#define F_NXDOMAIN (1u<<10)
|
#define F_NXDOMAIN (1u<<10)
|
||||||
#define F_CNAME (1u<<11)
|
#define F_CNAME (1u<<11)
|
||||||
#define F_NOERR (1u<<12)
|
#define F_DNSKEY (1u<<12)
|
||||||
#define F_CONFIG (1u<<13)
|
#define F_CONFIG (1u<<13)
|
||||||
|
#define F_DS (1u<<14)
|
||||||
|
#define F_DNSSECOK (1u<<15)
|
||||||
|
|
||||||
/* below here are only valid as args to log_query: cache
|
/* below here are only valid as args to log_query: cache
|
||||||
entries are limited to 16 bits */
|
entries are limited to 16 bits */
|
||||||
#define F_UPSTREAM (1u<<16)
|
#define F_UPSTREAM (1u<<16)
|
||||||
#define F_RRNAME (1u<<17)
|
#define F_RRNAME (1u<<17)
|
||||||
#define F_SERVER (1u<<18)
|
#define F_SERVER (1u<<18)
|
||||||
#define F_QUERY (1u<<19)
|
#define F_QUERY (1u<<19)
|
||||||
|
#define F_NOERR (1u<<20)
|
||||||
|
/* composites */
|
||||||
|
#define F_TYPE (F_IPV4 | F_IPV6 | F_DNSKEY | F_DS) /* Only one may be set */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* struct sockaddr is not large enough to hold any address,
|
/* struct sockaddr is not large enough to hold any address,
|
||||||
@@ -388,14 +412,14 @@ struct server {
|
|||||||
struct irec {
|
struct irec {
|
||||||
union mysockaddr addr;
|
union mysockaddr addr;
|
||||||
struct in_addr netmask; /* only valid for IPv4 */
|
struct in_addr netmask; /* only valid for IPv4 */
|
||||||
int tftp_ok, mtu, done, dad;
|
int tftp_ok, dhcp_ok, mtu, done, dad;
|
||||||
char *name;
|
char *name;
|
||||||
struct irec *next;
|
struct irec *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct listener {
|
struct listener {
|
||||||
int fd, tcpfd, tftpfd, family;
|
int fd, tcpfd, tftpfd, family;
|
||||||
struct irec *iface; /* only valid for non-wildcard */
|
struct irec *iface; /* only sometimes valid for non-wildcard */
|
||||||
struct listener *next;
|
struct listener *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -403,7 +427,7 @@ struct listener {
|
|||||||
struct iname {
|
struct iname {
|
||||||
char *name;
|
char *name;
|
||||||
union mysockaddr addr;
|
union mysockaddr addr;
|
||||||
int isloop, used;
|
int used;
|
||||||
struct iname *next;
|
struct iname *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -451,7 +475,7 @@ struct frec {
|
|||||||
#define OT_NAME 0x1000
|
#define OT_NAME 0x1000
|
||||||
#define OT_CSTRING 0x0800
|
#define OT_CSTRING 0x0800
|
||||||
#define OT_DEC 0x0400
|
#define OT_DEC 0x0400
|
||||||
|
#define OT_TIME 0x0200
|
||||||
|
|
||||||
/* actions in the daemon->helper RPC */
|
/* actions in the daemon->helper RPC */
|
||||||
#define ACTION_DEL 1
|
#define ACTION_DEL 1
|
||||||
@@ -641,18 +665,20 @@ struct dhcp_context {
|
|||||||
time_t ra_time;
|
time_t ra_time;
|
||||||
#endif
|
#endif
|
||||||
int flags;
|
int flags;
|
||||||
char *interface;
|
|
||||||
struct dhcp_netid netid, *filter;
|
struct dhcp_netid netid, *filter;
|
||||||
struct dhcp_context *next, *current;
|
struct dhcp_context *next, *current;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CONTEXT_STATIC 1
|
#define CONTEXT_STATIC 1
|
||||||
#define CONTEXT_NETMASK 2
|
#define CONTEXT_NETMASK 2
|
||||||
#define CONTEXT_BRDCAST 4
|
#define CONTEXT_BRDCAST 4
|
||||||
#define CONTEXT_PROXY 8
|
#define CONTEXT_PROXY 8
|
||||||
#define CONTEXT_RA_ONLY 16
|
#define CONTEXT_RA_ONLY 16
|
||||||
#define CONTEXT_RA_DONE 32
|
#define CONTEXT_RA_DONE 32
|
||||||
#define CONTEXT_RA_NAME 64
|
#define CONTEXT_RA_NAME 64
|
||||||
|
#define CONTEXT_RA_STATELESS 128
|
||||||
|
#define CONTEXT_DHCP 256
|
||||||
|
#define CONTEXT_DEPRECATE 512
|
||||||
|
|
||||||
struct ping_result {
|
struct ping_result {
|
||||||
struct in_addr addr;
|
struct in_addr addr;
|
||||||
@@ -686,11 +712,6 @@ struct addr_list {
|
|||||||
struct addr_list *next;
|
struct addr_list *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct interface_list {
|
|
||||||
char *interface;
|
|
||||||
struct interface_list *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct tftp_prefix {
|
struct tftp_prefix {
|
||||||
char *interface;
|
char *interface;
|
||||||
char *prefix;
|
char *prefix;
|
||||||
@@ -708,7 +729,7 @@ extern struct daemon {
|
|||||||
time_t last_resolv;
|
time_t last_resolv;
|
||||||
struct mx_srv_record *mxnames;
|
struct mx_srv_record *mxnames;
|
||||||
struct naptr *naptr;
|
struct naptr *naptr;
|
||||||
struct txt_record *txt;
|
struct txt_record *txt, *rr;
|
||||||
struct ptr_record *ptr;
|
struct ptr_record *ptr;
|
||||||
struct host_record *host_records, *host_records_tail;
|
struct host_record *host_records, *host_records_tail;
|
||||||
struct cname *cnames;
|
struct cname *cnames;
|
||||||
@@ -754,8 +775,6 @@ extern struct daemon {
|
|||||||
unsigned short edns_pktsz;
|
unsigned short edns_pktsz;
|
||||||
char *tftp_prefix;
|
char *tftp_prefix;
|
||||||
struct tftp_prefix *if_prefix; /* per-interface TFTP prefixes */
|
struct tftp_prefix *if_prefix; /* per-interface TFTP prefixes */
|
||||||
struct interface_list *tftp_interfaces; /* interfaces for limited TFTP service */
|
|
||||||
int tftp_unlimited;
|
|
||||||
unsigned int duid_enterprise, duid_config_len;
|
unsigned int duid_enterprise, duid_config_len;
|
||||||
unsigned char *duid_config;
|
unsigned char *duid_config;
|
||||||
|
|
||||||
@@ -835,6 +854,10 @@ char *get_domain(struct in_addr addr);
|
|||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
char *get_domain6(struct in6_addr *addr);
|
char *get_domain6(struct in6_addr *addr);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_DNSSEC
|
||||||
|
struct keydata *keydata_alloc(char *data, size_t len);
|
||||||
|
void keydata_free(struct keydata *blocks);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* rfc1035.c */
|
/* rfc1035.c */
|
||||||
unsigned int extract_request(struct dns_header *header, size_t qlen,
|
unsigned int extract_request(struct dns_header *header, size_t qlen,
|
||||||
@@ -902,6 +925,7 @@ char *option_string(int prot, unsigned int opt, unsigned char *val,
|
|||||||
int opt_len, char *buf, int buf_len);
|
int opt_len, char *buf, int buf_len);
|
||||||
void reread_dhcp(void);
|
void reread_dhcp(void);
|
||||||
void set_option_bool(unsigned int opt);
|
void set_option_bool(unsigned int opt);
|
||||||
|
void reset_option_bool(unsigned int opt);
|
||||||
struct hostsfile *expand_filelist(struct hostsfile *list);
|
struct hostsfile *expand_filelist(struct hostsfile *list);
|
||||||
|
|
||||||
/* forward.c */
|
/* forward.c */
|
||||||
@@ -911,7 +935,7 @@ unsigned char *tcp_request(int confd, time_t now,
|
|||||||
union mysockaddr *local_addr, struct in_addr netmask);
|
union mysockaddr *local_addr, struct in_addr netmask);
|
||||||
void server_gone(struct server *server);
|
void server_gone(struct server *server);
|
||||||
struct frec *get_new_frec(time_t now, int *wait);
|
struct frec *get_new_frec(time_t now, int *wait);
|
||||||
void send_from(int fd, int nowild, char *packet, size_t len,
|
int send_from(int fd, int nowild, char *packet, size_t len,
|
||||||
union mysockaddr *to, struct all_addr *source,
|
union mysockaddr *to, struct all_addr *source,
|
||||||
unsigned int iface);
|
unsigned int iface);
|
||||||
|
|
||||||
@@ -972,7 +996,7 @@ u64 lease_find_max_addr6(struct dhcp_context *context);
|
|||||||
void lease_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface);
|
void lease_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface);
|
||||||
#endif
|
#endif
|
||||||
void lease_set_hwaddr(struct dhcp_lease *lease, unsigned char *hwaddr,
|
void lease_set_hwaddr(struct dhcp_lease *lease, unsigned char *hwaddr,
|
||||||
unsigned char *clid, int hw_len, int hw_type, int clid_len, time_t now);
|
unsigned char *clid, int hw_len, int hw_type, int clid_len, time_t now, int force);
|
||||||
void lease_set_hostname(struct dhcp_lease *lease, char *name, int auth, char *domain, char *config_domain);
|
void lease_set_hostname(struct dhcp_lease *lease, char *name, int auth, char *domain, char *config_domain);
|
||||||
void lease_set_expires(struct dhcp_lease *lease, unsigned int len, time_t now);
|
void lease_set_expires(struct dhcp_lease *lease, unsigned int len, time_t now);
|
||||||
void lease_set_interface(struct dhcp_lease *lease, int interface, time_t now);
|
void lease_set_interface(struct dhcp_lease *lease, int interface, time_t now);
|
||||||
@@ -1099,12 +1123,14 @@ char *strip_hostname(char *hostname);
|
|||||||
void log_tags(struct dhcp_netid *netid, u32 xid);
|
void log_tags(struct dhcp_netid *netid, u32 xid);
|
||||||
int match_bytes(struct dhcp_opt *o, unsigned char *p, int len);
|
int match_bytes(struct dhcp_opt *o, unsigned char *p, int len);
|
||||||
void dhcp_update_configs(struct dhcp_config *configs);
|
void dhcp_update_configs(struct dhcp_config *configs);
|
||||||
void check_dhcp_hosts(int fatal);
|
|
||||||
void display_opts(void);
|
void display_opts(void);
|
||||||
u16 lookup_dhcp_opt(int prot, char *name);
|
u16 lookup_dhcp_opt(int prot, char *name);
|
||||||
u16 lookup_dhcp_len(int prot, u16 val);
|
u16 lookup_dhcp_len(int prot, u16 val);
|
||||||
char *option_string(int prot, unsigned int opt, unsigned char *val,
|
char *option_string(int prot, unsigned int opt, unsigned char *val,
|
||||||
int opt_len, char *buf, int buf_len);
|
int opt_len, char *buf, int buf_len);
|
||||||
|
#ifdef HAVE_LINUX_NETWORK
|
||||||
|
void bindtodevice(int fd);
|
||||||
|
#endif
|
||||||
# ifdef HAVE_DHCP6
|
# ifdef HAVE_DHCP6
|
||||||
void display_opts6(void);
|
void display_opts6(void);
|
||||||
void join_multicast(void);
|
void join_multicast(void);
|
||||||
@@ -1135,7 +1161,7 @@ void ra_start_unsolicted(time_t now, struct dhcp_context *context);
|
|||||||
/* slaac.c */
|
/* slaac.c */
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
void build_subnet_map(void);
|
void build_subnet_map(void);
|
||||||
void slaac_add_addrs(struct dhcp_lease *lease, time_t now);
|
void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force);
|
||||||
time_t periodic_slaac(time_t now, struct dhcp_lease *leases);
|
time_t periodic_slaac(time_t now, struct dhcp_lease *leases);
|
||||||
void slaac_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface, struct dhcp_lease *leases);
|
void slaac_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface, struct dhcp_lease *leases);
|
||||||
void schedule_subnet_map(void);
|
void schedule_subnet_map(void);
|
||||||
|
|||||||
+12
-8
@@ -26,9 +26,9 @@ static struct randfd *allocate_rfd(int family);
|
|||||||
|
|
||||||
/* Send a UDP packet with its source address set as "source"
|
/* Send a UDP packet with its source address set as "source"
|
||||||
unless nowild is true, when we just send it with the kernel default */
|
unless nowild is true, when we just send it with the kernel default */
|
||||||
void send_from(int fd, int nowild, char *packet, size_t len,
|
int send_from(int fd, int nowild, char *packet, size_t len,
|
||||||
union mysockaddr *to, struct all_addr *source,
|
union mysockaddr *to, struct all_addr *source,
|
||||||
unsigned int iface)
|
unsigned int iface)
|
||||||
{
|
{
|
||||||
struct msghdr msg;
|
struct msghdr msg;
|
||||||
struct iovec iov[1];
|
struct iovec iov[1];
|
||||||
@@ -111,7 +111,11 @@ void send_from(int fd, int nowild, char *packet, size_t len,
|
|||||||
goto retry;
|
goto retry;
|
||||||
|
|
||||||
my_syslog(LOG_ERR, _("failed to send packet: %s"), strerror(errno));
|
my_syslog(LOG_ERR, _("failed to send packet: %s"), strerror(errno));
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int search_servers(time_t now, struct all_addr **addrpp,
|
static unsigned int search_servers(time_t now, struct all_addr **addrpp,
|
||||||
@@ -432,7 +436,7 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
|
|||||||
if (udpfd != -1)
|
if (udpfd != -1)
|
||||||
{
|
{
|
||||||
plen = setup_reply(header, plen, addrp, flags, daemon->local_ttl);
|
plen = setup_reply(header, plen, addrp, flags, daemon->local_ttl);
|
||||||
send_from(udpfd, option_bool(OPT_NOWILD), (char *)header, plen, udpaddr, dst_addr, dst_iface);
|
send_from(udpfd, option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND), (char *)header, plen, udpaddr, dst_addr, dst_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -620,7 +624,7 @@ void reply_query(int fd, int family, time_t now)
|
|||||||
{
|
{
|
||||||
header->id = htons(forward->orig_id);
|
header->id = htons(forward->orig_id);
|
||||||
header->hb4 |= HB4_RA; /* recursion if available */
|
header->hb4 |= HB4_RA; /* recursion if available */
|
||||||
send_from(forward->fd, option_bool(OPT_NOWILD), daemon->packet, nn,
|
send_from(forward->fd, option_bool(OPT_NOWILD) || option_bool (OPT_CLEVERBIND), daemon->packet, nn,
|
||||||
&forward->source, &forward->dest, forward->iface);
|
&forward->source, &forward->dest, forward->iface);
|
||||||
}
|
}
|
||||||
free_frec(forward); /* cancel */
|
free_frec(forward); /* cancel */
|
||||||
@@ -660,7 +664,7 @@ void receive_query(struct listener *listen, time_t now)
|
|||||||
/* packet buffer overwritten */
|
/* packet buffer overwritten */
|
||||||
daemon->srv_save = NULL;
|
daemon->srv_save = NULL;
|
||||||
|
|
||||||
if (listen->family == AF_INET && option_bool(OPT_NOWILD))
|
if (listen->iface && listen->family == AF_INET && option_bool(OPT_NOWILD))
|
||||||
{
|
{
|
||||||
dst_addr_4 = listen->iface->addr.in.sin_addr;
|
dst_addr_4 = listen->iface->addr.in.sin_addr;
|
||||||
netmask = listen->iface->netmask;
|
netmask = listen->iface->netmask;
|
||||||
@@ -815,8 +819,8 @@ void receive_query(struct listener *listen, time_t now)
|
|||||||
dst_addr_4, netmask, now);
|
dst_addr_4, netmask, now);
|
||||||
if (m >= 1)
|
if (m >= 1)
|
||||||
{
|
{
|
||||||
send_from(listen->fd, option_bool(OPT_NOWILD), (char *)header,
|
send_from(listen->fd, option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND),
|
||||||
m, &source_addr, &dst_addr, if_index);
|
(char *)header, m, &source_addr, &dst_addr, if_index);
|
||||||
daemon->local_answer++;
|
daemon->local_answer++;
|
||||||
}
|
}
|
||||||
else if (forward_query(listen->fd, &source_addr, &dst_addr, if_index,
|
else if (forward_query(listen->fd, &source_addr, &dst_addr, if_index,
|
||||||
|
|||||||
+24
-11
@@ -98,7 +98,7 @@ void lease_init(time_t now)
|
|||||||
hw_type = ARPHRD_ETHER;
|
hw_type = ARPHRD_ETHER;
|
||||||
|
|
||||||
lease_set_hwaddr(lease, (unsigned char *)daemon->dhcp_buff2, (unsigned char *)daemon->packet,
|
lease_set_hwaddr(lease, (unsigned char *)daemon->dhcp_buff2, (unsigned char *)daemon->packet,
|
||||||
hw_len, hw_type, clid_len, now);
|
hw_len, hw_type, clid_len, now, 0);
|
||||||
|
|
||||||
if (strcmp(daemon->dhcp_buff, "*") != 0)
|
if (strcmp(daemon->dhcp_buff, "*") != 0)
|
||||||
lease_set_hostname(lease, daemon->dhcp_buff, 0, get_domain(lease->addr), NULL);
|
lease_set_hostname(lease, daemon->dhcp_buff, 0, get_domain(lease->addr), NULL);
|
||||||
@@ -119,7 +119,7 @@ void lease_init(time_t now)
|
|||||||
|
|
||||||
if ((lease = lease6_allocate(&addr.addr.addr6, lease_type)))
|
if ((lease = lease6_allocate(&addr.addr.addr6, lease_type)))
|
||||||
{
|
{
|
||||||
lease_set_hwaddr(lease, NULL, (unsigned char *)daemon->packet, 0, hw_type, clid_len, now);
|
lease_set_hwaddr(lease, NULL, (unsigned char *)daemon->packet, 0, hw_type, clid_len, now, 0);
|
||||||
|
|
||||||
if (strcmp(daemon->dhcp_buff, "*") != 0)
|
if (strcmp(daemon->dhcp_buff, "*") != 0)
|
||||||
lease_set_hostname(lease, daemon->dhcp_buff, 0, get_domain6((struct in6_addr *)lease->hwaddr), NULL);
|
lease_set_hostname(lease, daemon->dhcp_buff, 0, get_domain6((struct in6_addr *)lease->hwaddr), NULL);
|
||||||
@@ -310,12 +310,19 @@ void lease_update_file(time_t now)
|
|||||||
/* do timed RAs and determine when the next is, also pings to potential SLAAC addresses */
|
/* do timed RAs and determine when the next is, also pings to potential SLAAC addresses */
|
||||||
if (daemon->ra_contexts)
|
if (daemon->ra_contexts)
|
||||||
{
|
{
|
||||||
time_t ra_event = periodic_slaac(now, leases);
|
time_t event;
|
||||||
|
|
||||||
next_event = periodic_ra(now);
|
if ((event = periodic_slaac(now, leases)) != 0)
|
||||||
|
{
|
||||||
|
if (next_event == 0 || difftime(next_event, event) > 0.0)
|
||||||
|
next_event = event;
|
||||||
|
}
|
||||||
|
|
||||||
if (next_event == 0 || difftime(next_event, ra_event) > 0.0)
|
if ((event = periodic_ra(now)) != 0)
|
||||||
next_event = ra_event;
|
{
|
||||||
|
if (next_event == 0 || difftime(next_event, event) > 0.0)
|
||||||
|
next_event = event;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -373,7 +380,10 @@ static int find_interface_v6(struct in6_addr *local, int prefix,
|
|||||||
|
|
||||||
void lease_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface)
|
void lease_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface)
|
||||||
{
|
{
|
||||||
slaac_ping_reply(sender, packet, interface, leases);
|
/* We may be doing RA but not DHCPv4, in which case the lease
|
||||||
|
database may not exist and we have nothing to do anyway */
|
||||||
|
if (daemon->dhcp)
|
||||||
|
slaac_ping_reply(sender, packet, interface, leases);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -699,13 +709,16 @@ void lease_set_expires(struct dhcp_lease *lease, unsigned int len, time_t now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void lease_set_hwaddr(struct dhcp_lease *lease, unsigned char *hwaddr,
|
void lease_set_hwaddr(struct dhcp_lease *lease, unsigned char *hwaddr,
|
||||||
unsigned char *clid, int hw_len, int hw_type, int clid_len, time_t now)
|
unsigned char *clid, int hw_len, int hw_type, int clid_len,
|
||||||
|
time_t now, int force)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
int change = 0;
|
int change = force;
|
||||||
lease->flags |= LEASE_HAVE_HWADDR;
|
lease->flags |= LEASE_HAVE_HWADDR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
(void)force;
|
||||||
|
|
||||||
if (hw_len != lease->hwaddr_len ||
|
if (hw_len != lease->hwaddr_len ||
|
||||||
hw_type != lease->hwaddr_type ||
|
hw_type != lease->hwaddr_type ||
|
||||||
(hw_len != 0 && memcmp(lease->hwaddr, hwaddr, hw_len) != 0))
|
(hw_len != 0 && memcmp(lease->hwaddr, hwaddr, hw_len) != 0))
|
||||||
@@ -755,7 +768,7 @@ void lease_set_hwaddr(struct dhcp_lease *lease, unsigned char *hwaddr,
|
|||||||
|
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
if (change)
|
if (change)
|
||||||
slaac_add_addrs(lease, now);
|
slaac_add_addrs(lease, now, force);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -883,7 +896,7 @@ void lease_set_interface(struct dhcp_lease *lease, int interface, time_t now)
|
|||||||
lease->flags |= LEASE_CHANGED;
|
lease->flags |= LEASE_CHANGED;
|
||||||
|
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
slaac_add_addrs(lease, now);
|
slaac_add_addrs(lease, now, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+79
-58
@@ -38,8 +38,7 @@
|
|||||||
static struct iovec iov;
|
static struct iovec iov;
|
||||||
static u32 netlink_pid;
|
static u32 netlink_pid;
|
||||||
|
|
||||||
static void nl_err(struct nlmsghdr *h);
|
static int nl_async(struct nlmsghdr *h);
|
||||||
static void nl_routechange(struct nlmsghdr *h);
|
|
||||||
|
|
||||||
void netlink_init(void)
|
void netlink_init(void)
|
||||||
{
|
{
|
||||||
@@ -49,10 +48,13 @@ void netlink_init(void)
|
|||||||
addr.nl_family = AF_NETLINK;
|
addr.nl_family = AF_NETLINK;
|
||||||
addr.nl_pad = 0;
|
addr.nl_pad = 0;
|
||||||
addr.nl_pid = 0; /* autobind */
|
addr.nl_pid = 0; /* autobind */
|
||||||
#ifdef HAVE_IPV6
|
|
||||||
addr.nl_groups = RTMGRP_IPV4_ROUTE | RTMGRP_IPV6_ROUTE;
|
|
||||||
#else
|
|
||||||
addr.nl_groups = RTMGRP_IPV4_ROUTE;
|
addr.nl_groups = RTMGRP_IPV4_ROUTE;
|
||||||
|
if (option_bool(OPT_CLEVERBIND))
|
||||||
|
addr.nl_groups |= RTMGRP_IPV4_IFADDR;
|
||||||
|
#ifdef HAVE_IPV6
|
||||||
|
addr.nl_groups |= RTMGRP_IPV6_ROUTE;
|
||||||
|
if (daemon->ra_contexts || option_bool(OPT_CLEVERBIND))
|
||||||
|
addr.nl_groups |= RTMGRP_IPV6_IFADDR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* May not be able to have permission to set multicast groups don't die in that case */
|
/* May not be able to have permission to set multicast groups don't die in that case */
|
||||||
@@ -136,7 +138,7 @@ int iface_enumerate(int family, void *parm, int (*callback)())
|
|||||||
struct nlmsghdr *h;
|
struct nlmsghdr *h;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
static unsigned int seq = 0;
|
static unsigned int seq = 0;
|
||||||
int callback_ok = 1;
|
int callback_ok = 1, newaddr = 0;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct nlmsghdr nlh;
|
struct nlmsghdr nlh;
|
||||||
@@ -182,12 +184,24 @@ int iface_enumerate(int family, void *parm, int (*callback)())
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (h = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(h, (size_t)len); h = NLMSG_NEXT(h, len))
|
for (h = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(h, (size_t)len); h = NLMSG_NEXT(h, len))
|
||||||
if (h->nlmsg_seq != seq || h->nlmsg_pid != netlink_pid)
|
if (h->nlmsg_seq != seq || h->nlmsg_pid != netlink_pid || h->nlmsg_type == NLMSG_ERROR)
|
||||||
nl_routechange(h); /* May be multicast arriving async */
|
{
|
||||||
else if (h->nlmsg_type == NLMSG_ERROR)
|
/* May be multicast arriving async */
|
||||||
nl_err(h);
|
if (nl_async(h) && option_bool(OPT_CLEVERBIND))
|
||||||
|
newaddr = 1;
|
||||||
|
}
|
||||||
else if (h->nlmsg_type == NLMSG_DONE)
|
else if (h->nlmsg_type == NLMSG_DONE)
|
||||||
return callback_ok;
|
{
|
||||||
|
/* handle async new interface address arrivals, these have to be done
|
||||||
|
after we complete as we're not re-entrant */
|
||||||
|
if (newaddr)
|
||||||
|
{
|
||||||
|
enumerate_interfaces();
|
||||||
|
create_bound_listeners(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return callback_ok;
|
||||||
|
}
|
||||||
else if (h->nlmsg_type == RTM_NEWADDR && family != AF_UNSPEC && family != AF_LOCAL)
|
else if (h->nlmsg_type == RTM_NEWADDR && family != AF_UNSPEC && family != AF_LOCAL)
|
||||||
{
|
{
|
||||||
struct ifaddrmsg *ifa = NLMSG_DATA(h);
|
struct ifaddrmsg *ifa = NLMSG_DATA(h);
|
||||||
@@ -295,7 +309,7 @@ void netlink_multicast(void)
|
|||||||
{
|
{
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
struct nlmsghdr *h;
|
struct nlmsghdr *h;
|
||||||
int flags;
|
int flags, newaddr = 0;
|
||||||
|
|
||||||
/* don't risk blocking reading netlink messages here. */
|
/* don't risk blocking reading netlink messages here. */
|
||||||
if ((flags = fcntl(daemon->netlinkfd, F_GETFL)) == -1 ||
|
if ((flags = fcntl(daemon->netlinkfd, F_GETFL)) == -1 ||
|
||||||
@@ -303,45 +317,62 @@ void netlink_multicast(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if ((len = netlink_recv()) != -1)
|
if ((len = netlink_recv()) != -1)
|
||||||
{
|
for (h = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(h, (size_t)len); h = NLMSG_NEXT(h, len))
|
||||||
for (h = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(h, (size_t)len); h = NLMSG_NEXT(h, len))
|
if (nl_async(h) && option_bool(OPT_CLEVERBIND))
|
||||||
if (h->nlmsg_type == NLMSG_ERROR)
|
newaddr = 1;
|
||||||
nl_err(h);
|
|
||||||
else
|
|
||||||
nl_routechange(h);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* restore non-blocking status */
|
|
||||||
fcntl(daemon->netlinkfd, F_SETFL, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void nl_err(struct nlmsghdr *h)
|
|
||||||
{
|
|
||||||
struct nlmsgerr *err = NLMSG_DATA(h);
|
|
||||||
|
|
||||||
if (err->error != 0)
|
/* restore non-blocking status */
|
||||||
my_syslog(LOG_ERR, _("netlink returns error: %s"), strerror(-(err->error)));
|
fcntl(daemon->netlinkfd, F_SETFL, flags);
|
||||||
|
|
||||||
|
if (newaddr)
|
||||||
|
{
|
||||||
|
enumerate_interfaces();
|
||||||
|
create_bound_listeners(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We arrange to receive netlink multicast messages whenever the network route is added.
|
static int nl_async(struct nlmsghdr *h)
|
||||||
If this happens and we still have a DNS packet in the buffer, we re-send it.
|
|
||||||
This helps on DoD links, where frequently the packet which triggers dialling is
|
|
||||||
a DNS query, which then gets lost. By re-sending, we can avoid the lookup
|
|
||||||
failing. Note that we only accept these messages from the kernel (pid == 0) */
|
|
||||||
static void nl_routechange(struct nlmsghdr *h)
|
|
||||||
{
|
{
|
||||||
if (h->nlmsg_pid == 0 && h->nlmsg_type == RTM_NEWROUTE)
|
if (h->nlmsg_type == NLMSG_ERROR)
|
||||||
{
|
{
|
||||||
|
struct nlmsgerr *err = NLMSG_DATA(h);
|
||||||
|
my_syslog(LOG_ERR, _("netlink returns error: %s"), strerror(-(err->error)));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if (h->nlmsg_pid == 0 && h->nlmsg_type == RTM_NEWROUTE)
|
||||||
|
{
|
||||||
|
/* We arrange to receive netlink multicast messages whenever the network route is added.
|
||||||
|
If this happens and we still have a DNS packet in the buffer, we re-send it.
|
||||||
|
This helps on DoD links, where frequently the packet which triggers dialling is
|
||||||
|
a DNS query, which then gets lost. By re-sending, we can avoid the lookup
|
||||||
|
failing. */
|
||||||
struct rtmsg *rtm = NLMSG_DATA(h);
|
struct rtmsg *rtm = NLMSG_DATA(h);
|
||||||
int fd;
|
|
||||||
|
|
||||||
if (rtm->rtm_type != RTN_UNICAST || rtm->rtm_scope != RT_SCOPE_LINK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Force re-reading resolv file right now, for luck. */
|
|
||||||
daemon->last_resolv = 0;
|
|
||||||
|
|
||||||
|
if (rtm->rtm_type == RTN_UNICAST && rtm->rtm_scope == RT_SCOPE_LINK)
|
||||||
|
{
|
||||||
|
/* Force re-reading resolv file right now, for luck. */
|
||||||
|
daemon->last_resolv = 0;
|
||||||
|
|
||||||
|
if (daemon->srv_save)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
if (daemon->srv_save->sfd)
|
||||||
|
fd = daemon->srv_save->sfd->fd;
|
||||||
|
else if (daemon->rfd_save && daemon->rfd_save->refcount != 0)
|
||||||
|
fd = daemon->rfd_save->fd;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
while(sendto(fd, daemon->packet, daemon->packet_len, 0,
|
||||||
|
&daemon->srv_save->addr.sa, sa_len(&daemon->srv_save->addr)) == -1 && retry_send());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
|
else if (h->nlmsg_type == RTM_NEWADDR)
|
||||||
|
{
|
||||||
/* force RAs to sync new network and pick up new interfaces. */
|
/* force RAs to sync new network and pick up new interfaces. */
|
||||||
if (daemon->ra_contexts)
|
if (daemon->ra_contexts)
|
||||||
{
|
{
|
||||||
@@ -351,23 +382,13 @@ static void nl_routechange(struct nlmsghdr *h)
|
|||||||
iface_enumerate and can't re-enter it now */
|
iface_enumerate and can't re-enter it now */
|
||||||
send_alarm(0, 0);
|
send_alarm(0, 0);
|
||||||
}
|
}
|
||||||
#endif
|
return 1; /* clever bind mode - rescan */
|
||||||
|
|
||||||
if (daemon->srv_save)
|
|
||||||
{
|
|
||||||
if (daemon->srv_save->sfd)
|
|
||||||
fd = daemon->srv_save->sfd->fd;
|
|
||||||
else if (daemon->rfd_save && daemon->rfd_save->refcount != 0)
|
|
||||||
fd = daemon->rfd_save->fd;
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
while(sendto(fd, daemon->packet, daemon->packet_len, 0,
|
|
||||||
&daemon->srv_save->addr.sa, sa_len(&daemon->srv_save->addr)) == -1 && retry_send());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
+63
-57
@@ -117,18 +117,8 @@ int iface_check(int family, struct all_addr *addr, char *name)
|
|||||||
|
|
||||||
if (daemon->if_names || daemon->if_addrs)
|
if (daemon->if_names || daemon->if_addrs)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DHCP
|
|
||||||
struct dhcp_context *range;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
|
||||||
for (range = daemon->dhcp; range; range = range->next)
|
|
||||||
if (range->interface && strcmp(range->interface, name) == 0)
|
|
||||||
ret = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (tmp = daemon->if_names; tmp; tmp = tmp->next)
|
for (tmp = daemon->if_names; tmp; tmp = tmp->next)
|
||||||
if (tmp->name && (strcmp(tmp->name, name) == 0))
|
if (tmp->name && (strcmp(tmp->name, name) == 0))
|
||||||
ret = tmp->used = 1;
|
ret = tmp->used = 1;
|
||||||
@@ -161,11 +151,11 @@ static int iface_allowed(struct irec **irecp, int if_index,
|
|||||||
struct irec *iface;
|
struct irec *iface;
|
||||||
int fd, mtu = 0, loopback;
|
int fd, mtu = 0, loopback;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
int tftp_ok = daemon->tftp_unlimited;
|
int tftp_ok = !!option_bool(OPT_TFTP);
|
||||||
|
int dhcp_ok = 1;
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
struct iname *tmp;
|
struct iname *tmp;
|
||||||
#endif
|
#endif
|
||||||
struct interface_list *ir = NULL;
|
|
||||||
|
|
||||||
/* check whether the interface IP has been added already
|
/* check whether the interface IP has been added already
|
||||||
we call this routine multiple times. */
|
we call this routine multiple times. */
|
||||||
@@ -190,6 +180,9 @@ static int iface_allowed(struct irec **irecp, int if_index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
loopback = ifr.ifr_flags & IFF_LOOPBACK;
|
loopback = ifr.ifr_flags & IFF_LOOPBACK;
|
||||||
|
|
||||||
|
if (loopback)
|
||||||
|
dhcp_ok = 0;
|
||||||
|
|
||||||
if (ioctl(fd, SIOCGIFMTU, &ifr) != -1)
|
if (ioctl(fd, SIOCGIFMTU, &ifr) != -1)
|
||||||
mtu = ifr.ifr_mtu;
|
mtu = ifr.ifr_mtu;
|
||||||
@@ -203,50 +196,38 @@ static int iface_allowed(struct irec **irecp, int if_index,
|
|||||||
struct iname *lo;
|
struct iname *lo;
|
||||||
for (lo = daemon->if_names; lo; lo = lo->next)
|
for (lo = daemon->if_names; lo; lo = lo->next)
|
||||||
if (lo->name && strcmp(lo->name, ifr.ifr_name) == 0)
|
if (lo->name && strcmp(lo->name, ifr.ifr_name) == 0)
|
||||||
{
|
break;
|
||||||
lo->isloop = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!lo &&
|
if (!lo &&
|
||||||
(lo = whine_malloc(sizeof(struct iname))) &&
|
(lo = whine_malloc(sizeof(struct iname))) &&
|
||||||
(lo->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
(lo->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
||||||
{
|
{
|
||||||
strcpy(lo->name, ifr.ifr_name);
|
strcpy(lo->name, ifr.ifr_name);
|
||||||
lo->isloop = lo->used = 1;
|
lo->used = 1;
|
||||||
lo->next = daemon->if_names;
|
lo->next = daemon->if_names;
|
||||||
daemon->if_names = lo;
|
daemon->if_names = lo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_TFTP
|
if (addr->sa.sa_family == AF_INET &&
|
||||||
/* implement wierd TFTP service rules */
|
!iface_check(AF_INET, (struct all_addr *)&addr->in.sin_addr, ifr.ifr_name))
|
||||||
for (ir = daemon->tftp_interfaces; ir; ir = ir->next)
|
return 1;
|
||||||
if (strcmp(ir->interface, ifr.ifr_name) == 0)
|
|
||||||
|
#ifdef HAVE_DHCP
|
||||||
|
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
|
||||||
|
if (tmp->name && (strcmp(tmp->name, ifr.ifr_name) == 0))
|
||||||
{
|
{
|
||||||
tftp_ok = 1;
|
tftp_ok = 0;
|
||||||
break;
|
dhcp_ok = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ir)
|
|
||||||
{
|
|
||||||
if (addr->sa.sa_family == AF_INET &&
|
|
||||||
!iface_check(AF_INET, (struct all_addr *)&addr->in.sin_addr, ifr.ifr_name))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
|
||||||
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
|
|
||||||
if (tmp->name && (strcmp(tmp->name, ifr.ifr_name) == 0))
|
|
||||||
tftp_ok = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if (addr->sa.sa_family == AF_INET6 &&
|
if (addr->sa.sa_family == AF_INET6 &&
|
||||||
!iface_check(AF_INET6, (struct all_addr *)&addr->in6.sin6_addr, ifr.ifr_name))
|
!iface_check(AF_INET6, (struct all_addr *)&addr->in6.sin6_addr, ifr.ifr_name))
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
/* add to list */
|
/* add to list */
|
||||||
if ((iface = whine_malloc(sizeof(struct irec))))
|
if ((iface = whine_malloc(sizeof(struct irec))))
|
||||||
@@ -254,14 +235,18 @@ static int iface_allowed(struct irec **irecp, int if_index,
|
|||||||
iface->addr = *addr;
|
iface->addr = *addr;
|
||||||
iface->netmask = netmask;
|
iface->netmask = netmask;
|
||||||
iface->tftp_ok = tftp_ok;
|
iface->tftp_ok = tftp_ok;
|
||||||
|
iface->dhcp_ok = dhcp_ok;
|
||||||
iface->mtu = mtu;
|
iface->mtu = mtu;
|
||||||
iface->dad = dad;
|
iface->dad = dad;
|
||||||
iface->done = 0;
|
iface->done = 0;
|
||||||
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
||||||
strcpy(iface->name, ifr.ifr_name);
|
{
|
||||||
iface->next = *irecp;
|
strcpy(iface->name, ifr.ifr_name);
|
||||||
*irecp = iface;
|
iface->next = *irecp;
|
||||||
return 1;
|
*irecp = iface;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
free(iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
@@ -339,6 +324,7 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
|
|||||||
if ((fd = socket(family, type, 0)) == -1)
|
if ((fd = socket(family, type, 0)) == -1)
|
||||||
{
|
{
|
||||||
int port;
|
int port;
|
||||||
|
char *s;
|
||||||
|
|
||||||
/* No error if the kernel just doesn't support this IP flavour */
|
/* No error if the kernel just doesn't support this IP flavour */
|
||||||
if (errno == EPROTONOSUPPORT ||
|
if (errno == EPROTONOSUPPORT ||
|
||||||
@@ -347,15 +333,15 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
port = prettyprint_addr(addr, daemon->addrbuff);
|
||||||
|
if (!option_bool(OPT_NOWILD) && !option_bool(OPT_CLEVERBIND))
|
||||||
|
sprintf(daemon->addrbuff, "port %d", port);
|
||||||
|
s = _("failed to create listening socket for %s: %s");
|
||||||
|
|
||||||
if (dienow)
|
if (dienow)
|
||||||
{
|
die(s, daemon->addrbuff, EC_BADNET);
|
||||||
port = prettyprint_addr(addr, daemon->namebuff);
|
|
||||||
if (!option_bool(OPT_NOWILD))
|
my_syslog(LOG_ERR, s, daemon->addrbuff, strerror(errno));
|
||||||
sprintf(daemon->namebuff, "port %d", port);
|
|
||||||
die(_("failed to create listening socket for %s: %s"),
|
|
||||||
daemon->namebuff, EC_BADNET);
|
|
||||||
|
|
||||||
}
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,8 +462,7 @@ static struct listener *create_listeners(union mysockaddr *addr, int do_tftp, in
|
|||||||
void create_wildcard_listeners(void)
|
void create_wildcard_listeners(void)
|
||||||
{
|
{
|
||||||
union mysockaddr addr;
|
union mysockaddr addr;
|
||||||
struct listener *l;
|
struct listener *l, *l6;
|
||||||
int tftp_enabled = daemon->tftp_unlimited || daemon->tftp_interfaces;
|
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||||
@@ -487,7 +472,7 @@ void create_wildcard_listeners(void)
|
|||||||
addr.in.sin_addr.s_addr = INADDR_ANY;
|
addr.in.sin_addr.s_addr = INADDR_ANY;
|
||||||
addr.in.sin_port = htons(daemon->port);
|
addr.in.sin_port = htons(daemon->port);
|
||||||
|
|
||||||
l = create_listeners(&addr, tftp_enabled, 1);
|
l = create_listeners(&addr, !!option_bool(OPT_TFTP), 1);
|
||||||
|
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
@@ -497,11 +482,12 @@ void create_wildcard_listeners(void)
|
|||||||
addr.in6.sin6_family = AF_INET6;
|
addr.in6.sin6_family = AF_INET6;
|
||||||
addr.in6.sin6_addr = in6addr_any;
|
addr.in6.sin6_addr = in6addr_any;
|
||||||
addr.in6.sin6_port = htons(daemon->port);
|
addr.in6.sin6_port = htons(daemon->port);
|
||||||
|
|
||||||
|
l6 = create_listeners(&addr, !!option_bool(OPT_TFTP), 1);
|
||||||
if (l)
|
if (l)
|
||||||
l->next = create_listeners(&addr, tftp_enabled, 1);
|
l->next = l6;
|
||||||
else
|
else
|
||||||
l = create_listeners(&addr, tftp_enabled, 1);
|
l = l6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
daemon->listeners = l;
|
daemon->listeners = l;
|
||||||
@@ -511,6 +497,7 @@ void create_bound_listeners(int dienow)
|
|||||||
{
|
{
|
||||||
struct listener *new;
|
struct listener *new;
|
||||||
struct irec *iface;
|
struct irec *iface;
|
||||||
|
struct iname *if_tmp;
|
||||||
|
|
||||||
for (iface = daemon->interfaces; iface; iface = iface->next)
|
for (iface = daemon->interfaces; iface; iface = iface->next)
|
||||||
if (!iface->done && !iface->dad &&
|
if (!iface->done && !iface->dad &&
|
||||||
@@ -521,6 +508,25 @@ void create_bound_listeners(int dienow)
|
|||||||
daemon->listeners = new;
|
daemon->listeners = new;
|
||||||
iface->done = 1;
|
iface->done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check for --listen-address options that haven't been used because there's
|
||||||
|
no interface with a matching address. These may be valid: eg it's possible
|
||||||
|
to listen on 127.0.1.1 even if the loopback interface is 127.0.0.1
|
||||||
|
|
||||||
|
If the address isn't valid the bind() will fail and we'll die().
|
||||||
|
|
||||||
|
The resulting listeners have the ->iface field NULL, and this has to be
|
||||||
|
handled by the DNS and TFTP code. It disables --localise-queries processing
|
||||||
|
(no netmask) and some MTU login the tftp code. */
|
||||||
|
|
||||||
|
for (if_tmp = daemon->if_addrs; if_tmp; if_tmp = if_tmp->next)
|
||||||
|
if (!if_tmp->used &&
|
||||||
|
(new = create_listeners(&if_tmp->addr, !!option_bool(OPT_TFTP), dienow)))
|
||||||
|
{
|
||||||
|
new->iface = NULL;
|
||||||
|
new->next = daemon->listeners;
|
||||||
|
daemon->listeners = new;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int is_dad_listeners(void)
|
int is_dad_listeners(void)
|
||||||
|
|||||||
+462
-402
File diff suppressed because it is too large.
Load diff
+2
-1
@@ -14,7 +14,7 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ALL_HOSTS "FF02::1"
|
#define ALL_NODES "FF02::1"
|
||||||
#define ALL_ROUTERS "FF02::2"
|
#define ALL_ROUTERS "FF02::2"
|
||||||
|
|
||||||
struct ping_packet {
|
struct ping_packet {
|
||||||
@@ -43,6 +43,7 @@ struct prefix_opt {
|
|||||||
#define ICMP6_OPT_PREFIX 3
|
#define ICMP6_OPT_PREFIX 3
|
||||||
#define ICMP6_OPT_MTU 5
|
#define ICMP6_OPT_MTU 5
|
||||||
#define ICMP6_OPT_RDNSS 25
|
#define ICMP6_OPT_RDNSS 25
|
||||||
|
#define ICMP6_OPT_DNSSL 31
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+170
-101
@@ -27,8 +27,9 @@
|
|||||||
#include <netinet/icmp6.h>
|
#include <netinet/icmp6.h>
|
||||||
|
|
||||||
struct ra_param {
|
struct ra_param {
|
||||||
int ind, managed, found_context, first;
|
int ind, managed, other, found_context, first;
|
||||||
char *if_name;
|
char *if_name;
|
||||||
|
struct dhcp_netid *tags;
|
||||||
struct in6_addr link_local;
|
struct in6_addr link_local;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ void ra_init(time_t now)
|
|||||||
{
|
{
|
||||||
struct icmp6_filter filter;
|
struct icmp6_filter filter;
|
||||||
int fd;
|
int fd;
|
||||||
#if defined(IP_TOS) && defined(IPTOS_CLASS_CS6)
|
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
|
||||||
int class = IPTOS_CLASS_CS6;
|
int class = IPTOS_CLASS_CS6;
|
||||||
#endif
|
#endif
|
||||||
int val = 255; /* radvd uses this value */
|
int val = 255; /* radvd uses this value */
|
||||||
@@ -72,7 +73,7 @@ void ra_init(time_t now)
|
|||||||
|
|
||||||
if ((fd = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) == -1 ||
|
if ((fd = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) == -1 ||
|
||||||
getsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &hop_limit, &len) ||
|
getsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &hop_limit, &len) ||
|
||||||
#if defined(IP_TOS) && defined(IPTOS_CLASS_CS6)
|
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
|
||||||
setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &class, sizeof(class)) == -1 ||
|
setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &class, sizeof(class)) == -1 ||
|
||||||
#endif
|
#endif
|
||||||
!fix_fd(fd) ||
|
!fix_fd(fd) ||
|
||||||
@@ -116,10 +117,8 @@ void icmp6_packet(void)
|
|||||||
char control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
|
char control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
|
||||||
} control_u;
|
} control_u;
|
||||||
struct sockaddr_in6 from;
|
struct sockaddr_in6 from;
|
||||||
unsigned char *p;
|
unsigned char *packet;
|
||||||
char *mac = "";
|
|
||||||
struct iname *tmp;
|
struct iname *tmp;
|
||||||
struct dhcp_context *context;
|
|
||||||
|
|
||||||
/* Note: use outpacket for input buffer */
|
/* Note: use outpacket for input buffer */
|
||||||
msg.msg_control = control_u.control6;
|
msg.msg_control = control_u.control6;
|
||||||
@@ -132,6 +131,8 @@ void icmp6_packet(void)
|
|||||||
|
|
||||||
if ((sz = recv_dhcp_packet(daemon->icmp6fd, &msg)) == -1 || sz < 8)
|
if ((sz = recv_dhcp_packet(daemon->icmp6fd, &msg)) == -1 || sz < 8)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
packet = (unsigned char *)daemon->outpacket.iov_base;
|
||||||
|
|
||||||
for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr))
|
for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr))
|
||||||
if (cmptr->cmsg_level == IPPROTO_IPV6 && cmptr->cmsg_type == daemon->v6pktinfo)
|
if (cmptr->cmsg_level == IPPROTO_IPV6 && cmptr->cmsg_type == daemon->v6pktinfo)
|
||||||
@@ -155,41 +156,26 @@ void icmp6_packet(void)
|
|||||||
if (tmp->name && (strcmp(tmp->name, interface) == 0))
|
if (tmp->name && (strcmp(tmp->name, interface) == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* weird libvirt-inspired access control */
|
if (packet[1] != 0)
|
||||||
for (context = daemon->dhcp6; context; context = context->next)
|
|
||||||
if (!context->interface || strcmp(context->interface, interface) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!context)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = (unsigned char *)daemon->outpacket.iov_base;
|
|
||||||
|
|
||||||
if (p[1] != 0)
|
if (packet[0] == ICMP6_ECHO_REPLY)
|
||||||
return;
|
lease_ping_reply(&from.sin6_addr, packet, interface);
|
||||||
|
else if (packet[0] == ND_ROUTER_SOLICIT)
|
||||||
if (p[0] == ICMP6_ECHO_REPLY)
|
|
||||||
{
|
{
|
||||||
/* We may be doing RA but not DHCPv4, in which case the lease
|
char *mac = "";
|
||||||
database may not exist and we have nothing to do anyway */
|
|
||||||
if (daemon->dhcp)
|
/* look for link-layer address option for logging */
|
||||||
lease_ping_reply(&from.sin6_addr, p, interface);
|
if (sz >= 16 && packet[8] == ICMP6_OPT_SOURCE_MAC && (packet[9] * 8) + 8 <= sz)
|
||||||
return;
|
{
|
||||||
|
print_mac(daemon->namebuff, &packet[10], (packet[9] * 8) - 2);
|
||||||
|
mac = daemon->namebuff;
|
||||||
|
}
|
||||||
|
|
||||||
|
my_syslog(MS_DHCP | LOG_INFO, "RTR-SOLICIT(%s) %s", interface, mac);
|
||||||
|
/* source address may not be valid in solicit request. */
|
||||||
|
send_ra(if_index, interface, !IN6_IS_ADDR_UNSPECIFIED(&from.sin6_addr) ? &from.sin6_addr : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p[0] != ND_ROUTER_SOLICIT)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* look for link-layer address option for logging */
|
|
||||||
if (sz >= 16 && p[8] == ICMP6_OPT_SOURCE_MAC && (p[9] * 8) + 8 <= sz)
|
|
||||||
{
|
|
||||||
print_mac(daemon->namebuff, &p[10], (p[9] * 8) - 2);
|
|
||||||
mac = daemon->namebuff;
|
|
||||||
}
|
|
||||||
|
|
||||||
my_syslog(MS_DHCP | LOG_INFO, "RTR-SOLICIT(%s) %s", interface, mac);
|
|
||||||
|
|
||||||
send_ra(if_index, interface, &from.sin6_addr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_ra(int iface, char *iface_name, struct in6_addr *dest)
|
static void send_ra(int iface, char *iface_name, struct in6_addr *dest)
|
||||||
@@ -199,6 +185,9 @@ static void send_ra(int iface, char *iface_name, struct in6_addr *dest)
|
|||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
struct sockaddr_in6 addr;
|
struct sockaddr_in6 addr;
|
||||||
struct dhcp_context *context;
|
struct dhcp_context *context;
|
||||||
|
struct dhcp_netid iface_id;
|
||||||
|
struct dhcp_opt *opt_cfg;
|
||||||
|
int done_dns = 0;
|
||||||
|
|
||||||
save_counter(0);
|
save_counter(0);
|
||||||
ra = expand(sizeof(struct ra_packet));
|
ra = expand(sizeof(struct ra_packet));
|
||||||
@@ -213,13 +202,22 @@ static void send_ra(int iface, char *iface_name, struct in6_addr *dest)
|
|||||||
|
|
||||||
parm.ind = iface;
|
parm.ind = iface;
|
||||||
parm.managed = 0;
|
parm.managed = 0;
|
||||||
|
parm.other = 0;
|
||||||
parm.found_context = 0;
|
parm.found_context = 0;
|
||||||
parm.if_name = iface_name;
|
parm.if_name = iface_name;
|
||||||
parm.first = 1;
|
parm.first = 1;
|
||||||
|
|
||||||
for (context = daemon->ra_contexts; context; context = context->next)
|
/* set tag with name == interface */
|
||||||
context->flags &= ~CONTEXT_RA_DONE;
|
iface_id.net = iface_name;
|
||||||
|
iface_id.next = NULL;
|
||||||
|
parm.tags = &iface_id;
|
||||||
|
|
||||||
|
for (context = daemon->ra_contexts; context; context = context->next)
|
||||||
|
{
|
||||||
|
context->flags &= ~CONTEXT_RA_DONE;
|
||||||
|
context->netid.next = &context->netid;
|
||||||
|
}
|
||||||
|
|
||||||
if (!iface_enumerate(AF_INET6, &parm, add_prefixes) ||
|
if (!iface_enumerate(AF_INET6, &parm, add_prefixes) ||
|
||||||
!parm.found_context)
|
!parm.found_context)
|
||||||
return;
|
return;
|
||||||
@@ -235,19 +233,70 @@ static void send_ra(int iface, char *iface_name, struct in6_addr *dest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
iface_enumerate(AF_LOCAL, &iface, add_lla);
|
iface_enumerate(AF_LOCAL, &iface, add_lla);
|
||||||
|
|
||||||
|
/* RDNSS, RFC 6106, use relevant DHCP6 options */
|
||||||
|
(void)option_filter(parm.tags, NULL, daemon->dhcp_opts6);
|
||||||
|
|
||||||
/* RDNSS, RFC 6106 */
|
for (opt_cfg = daemon->dhcp_opts6; opt_cfg; opt_cfg = opt_cfg->next)
|
||||||
put_opt6_char(ICMP6_OPT_RDNSS);
|
{
|
||||||
put_opt6_char(3);
|
int i;
|
||||||
put_opt6_short(0);
|
|
||||||
put_opt6_long(1800); /* lifetime - twice RA retransmit */
|
/* netids match and not encapsulated? */
|
||||||
put_opt6(&parm.link_local, IN6ADDRSZ);
|
if (!(opt_cfg->flags & DHOPT_TAGOK))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (opt_cfg->opt == OPTION6_DNS_SERVER)
|
||||||
|
{
|
||||||
|
struct in6_addr *a = (struct in6_addr *)opt_cfg->val;
|
||||||
|
|
||||||
|
done_dns = 1;
|
||||||
|
if (opt_cfg->len == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
put_opt6_char(ICMP6_OPT_RDNSS);
|
||||||
|
put_opt6_char((opt_cfg->len/8) + 1);
|
||||||
|
put_opt6_short(0);
|
||||||
|
put_opt6_long(1800); /* lifetime - twice RA retransmit */
|
||||||
|
/* zero means "self" */
|
||||||
|
for (i = 0; i < opt_cfg->len; i += IN6ADDRSZ, a++)
|
||||||
|
if (IN6_IS_ADDR_UNSPECIFIED(a))
|
||||||
|
put_opt6(&parm.link_local, IN6ADDRSZ);
|
||||||
|
else
|
||||||
|
put_opt6(a, IN6ADDRSZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt_cfg->opt == OPTION6_DOMAIN_SEARCH && opt_cfg->len != 0)
|
||||||
|
{
|
||||||
|
int len = ((opt_cfg->len+7)/8);
|
||||||
|
|
||||||
|
put_opt6_char(ICMP6_OPT_DNSSL);
|
||||||
|
put_opt6_char(len + 1);
|
||||||
|
put_opt6_short(0);
|
||||||
|
put_opt6_long(1800); /* lifetime - twice RA retransmit */
|
||||||
|
put_opt6(opt_cfg->val, opt_cfg->len);
|
||||||
|
|
||||||
|
/* pad */
|
||||||
|
for (i = opt_cfg->len; i < len * 8; i++)
|
||||||
|
put_opt6_char(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!done_dns)
|
||||||
|
{
|
||||||
|
/* default == us. */
|
||||||
|
put_opt6_char(ICMP6_OPT_RDNSS);
|
||||||
|
put_opt6_char(3);
|
||||||
|
put_opt6_short(0);
|
||||||
|
put_opt6_long(1800); /* lifetime - twice RA retransmit */
|
||||||
|
put_opt6(&parm.link_local, IN6ADDRSZ);
|
||||||
|
}
|
||||||
|
|
||||||
/* set managed bits unless we're providing only RA on this link */
|
/* set managed bits unless we're providing only RA on this link */
|
||||||
if (parm.managed)
|
if (parm.managed)
|
||||||
ra->flags = 0xc0; /* M flag, managed, O flag, other */
|
ra->flags |= 0x80; /* M flag, managed, */
|
||||||
|
if (parm.other)
|
||||||
|
ra->flags |= 0x40; /* O flag, other */
|
||||||
|
|
||||||
/* decide where we're sending */
|
/* decide where we're sending */
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||||
@@ -263,7 +312,7 @@ static void send_ra(int iface, char *iface_name, struct in6_addr *dest)
|
|||||||
addr.sin6_scope_id = iface;
|
addr.sin6_scope_id = iface;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
inet_pton(AF_INET6, ALL_HOSTS, &addr.sin6_addr);
|
inet_pton(AF_INET6, ALL_NODES, &addr.sin6_addr);
|
||||||
|
|
||||||
send_from(daemon->icmp6fd, 0, daemon->outpacket.iov_base, save_counter(0),
|
send_from(daemon->icmp6fd, 0, daemon->outpacket.iov_base, save_counter(0),
|
||||||
(union mysockaddr *)&addr, (struct all_addr *)&parm.link_local, iface);
|
(union mysockaddr *)&addr, (struct all_addr *)&parm.link_local, iface);
|
||||||
@@ -273,9 +322,7 @@ static void send_ra(int iface, char *iface_name, struct in6_addr *dest)
|
|||||||
static int add_prefixes(struct in6_addr *local, int prefix,
|
static int add_prefixes(struct in6_addr *local, int prefix,
|
||||||
int scope, int if_index, int dad, void *vparam)
|
int scope, int if_index, int dad, void *vparam)
|
||||||
{
|
{
|
||||||
struct dhcp_context *context, *tmp;
|
|
||||||
struct ra_param *param = vparam;
|
struct ra_param *param = vparam;
|
||||||
struct prefix_opt *opt;
|
|
||||||
|
|
||||||
(void)scope; /* warning */
|
(void)scope; /* warning */
|
||||||
(void)dad;
|
(void)dad;
|
||||||
@@ -288,72 +335,94 @@ static int add_prefixes(struct in6_addr *local, int prefix,
|
|||||||
!IN6_IS_ADDR_LINKLOCAL(local) &&
|
!IN6_IS_ADDR_LINKLOCAL(local) &&
|
||||||
!IN6_IS_ADDR_MULTICAST(local))
|
!IN6_IS_ADDR_MULTICAST(local))
|
||||||
{
|
{
|
||||||
|
int do_prefix = 0;
|
||||||
|
int do_slaac = 0;
|
||||||
|
int deprecate = 0;
|
||||||
|
unsigned int time = 0xffffffff;
|
||||||
|
struct dhcp_context *context;
|
||||||
|
|
||||||
for (context = daemon->ra_contexts; context; context = context->next)
|
for (context = daemon->ra_contexts; context; context = context->next)
|
||||||
if (prefix == context->prefix &&
|
if (prefix == context->prefix &&
|
||||||
is_same_net6(local, &context->start6, prefix) &&
|
is_same_net6(local, &context->start6, prefix) &&
|
||||||
is_same_net6(local, &context->end6, prefix))
|
is_same_net6(local, &context->end6, prefix))
|
||||||
{
|
{
|
||||||
int do_slaac = 0;
|
if ((context->flags &
|
||||||
|
(CONTEXT_RA_ONLY | CONTEXT_RA_NAME | CONTEXT_RA_STATELESS)))
|
||||||
if (context->flags & CONTEXT_RA_ONLY)
|
{
|
||||||
do_slaac = 1;
|
do_slaac = 1;
|
||||||
|
if (context->flags & CONTEXT_DHCP)
|
||||||
|
{
|
||||||
|
param->other = 1;
|
||||||
|
if (!(context->flags & CONTEXT_RA_STATELESS))
|
||||||
|
param->managed = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* don't do RA for non-ra-only unless --enable-ra is set */
|
/* don't do RA for non-ra-only unless --enable-ra is set */
|
||||||
if (!option_bool(OPT_RA))
|
if (!option_bool(OPT_RA))
|
||||||
continue;
|
continue;
|
||||||
param->managed = 1;
|
param->managed = 1;
|
||||||
|
param->other = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context->flags & CONTEXT_RA_DONE)
|
/* find floor time */
|
||||||
continue;
|
if (time > context->lease_time)
|
||||||
|
time = context->lease_time;
|
||||||
|
|
||||||
/* subsequent prefixes on the same interface don't need timers */
|
if (context->flags & CONTEXT_DEPRECATE)
|
||||||
if (!param->first)
|
deprecate = 1;
|
||||||
context->ra_time = 0;
|
|
||||||
param->first = 0;
|
|
||||||
param->found_context = 1;
|
|
||||||
context->flags |= CONTEXT_RA_DONE;
|
|
||||||
|
|
||||||
/* mark this subnet and duplicates: as done. */
|
/* collect dhcp-range tags */
|
||||||
for (tmp = context->next; tmp; tmp = tmp->next)
|
if (context->netid.next == &context->netid && context->netid.net)
|
||||||
if (tmp->prefix == prefix &&
|
|
||||||
is_same_net6(local, &tmp->start6, prefix) &&
|
|
||||||
is_same_net6(local, &tmp->end6, prefix))
|
|
||||||
{
|
|
||||||
/* if any dhcp-range with ra-only on this subnet
|
|
||||||
set the "do_slaac" bit */
|
|
||||||
if (tmp->flags & CONTEXT_RA_ONLY)
|
|
||||||
do_slaac = 1;
|
|
||||||
tmp->flags |= CONTEXT_RA_DONE;
|
|
||||||
context->ra_time = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((opt = expand(sizeof(struct prefix_opt))))
|
|
||||||
{
|
{
|
||||||
u64 addrpart = addr6part(&context->start6);
|
context->netid.next = param->tags;
|
||||||
u64 mask = (prefix == 64) ? (u64)-1LL : (1LLU << (128 - prefix)) - 1LLU;
|
param->tags = &context->netid;
|
||||||
unsigned int time = context->lease_time;
|
|
||||||
|
|
||||||
/* lifetimes must be min 2 hrs, by RFC 2462 */
|
|
||||||
if (time < 7200)
|
|
||||||
time = 7200;
|
|
||||||
|
|
||||||
opt->type = ICMP6_OPT_PREFIX;
|
|
||||||
opt->len = 4;
|
|
||||||
opt->prefix_len = prefix;
|
|
||||||
/* autonomous only is we're not doing dhcp */
|
|
||||||
opt->flags = do_slaac ? 0x40 : 0x00;
|
|
||||||
opt->valid_lifetime = opt->preferred_lifetime = htonl(time);
|
|
||||||
opt->reserved = 0;
|
|
||||||
|
|
||||||
opt->prefix = context->start6;
|
|
||||||
setaddr6part(&opt->prefix, addrpart & ~mask);
|
|
||||||
|
|
||||||
inet_ntop(AF_INET6, &opt->prefix, daemon->addrbuff, ADDRSTRLEN);
|
|
||||||
my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s", param->if_name, daemon->addrbuff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* subsequent prefixes on the same interface
|
||||||
|
and subsequent instances of this prefix don't need timers.
|
||||||
|
Be careful not to find the same prefix twice with different
|
||||||
|
addresses. */
|
||||||
|
if (!(context->flags & CONTEXT_RA_DONE))
|
||||||
|
{
|
||||||
|
if (!param->first)
|
||||||
|
context->ra_time = 0;
|
||||||
|
context->flags |= CONTEXT_RA_DONE;
|
||||||
|
do_prefix = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
param->first = 0;
|
||||||
|
param->found_context = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (do_prefix)
|
||||||
|
{
|
||||||
|
struct prefix_opt *opt;
|
||||||
|
|
||||||
|
if ((opt = expand(sizeof(struct prefix_opt))))
|
||||||
|
{
|
||||||
|
/* zero net part of address */
|
||||||
|
setaddr6part(local, addr6part(local) & ~((prefix == 64) ? (u64)-1LL : (1LLU << (128 - prefix)) - 1LLU));
|
||||||
|
|
||||||
|
/* lifetimes must be min 2 hrs, by RFC 2462 */
|
||||||
|
if (time < 7200)
|
||||||
|
time = 7200;
|
||||||
|
|
||||||
|
opt->type = ICMP6_OPT_PREFIX;
|
||||||
|
opt->len = 4;
|
||||||
|
opt->prefix_len = prefix;
|
||||||
|
/* autonomous only if we're not doing dhcp */
|
||||||
|
opt->flags = do_slaac ? 0x40 : 0x00;
|
||||||
|
opt->valid_lifetime = htonl(time);
|
||||||
|
opt->preferred_lifetime = htonl(deprecate ? 0 : time);
|
||||||
|
opt->reserved = 0;
|
||||||
|
opt->prefix = *local;
|
||||||
|
|
||||||
|
inet_ntop(AF_INET6, local, daemon->addrbuff, ADDRSTRLEN);
|
||||||
|
my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s", param->if_name, daemon->addrbuff);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@@ -395,11 +464,11 @@ time_t periodic_ra(time_t now)
|
|||||||
for (next_event = 0, context = daemon->ra_contexts; context; context = context->next)
|
for (next_event = 0, context = daemon->ra_contexts; context; context = context->next)
|
||||||
if (context->ra_time != 0)
|
if (context->ra_time != 0)
|
||||||
{
|
{
|
||||||
if (difftime(context->ra_time, now) < 0.0)
|
if (difftime(context->ra_time, now) <= 0.0)
|
||||||
break; /* overdue */
|
break; /* overdue */
|
||||||
|
|
||||||
if (next_event == 0 || difftime(next_event, context->ra_time + 2) > 0.0)
|
if (next_event == 0 || difftime(next_event, context->ra_time) > 0.0)
|
||||||
next_event = context->ra_time + 2;
|
next_event = context->ra_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* none overdue */
|
/* none overdue */
|
||||||
|
|||||||
+60
-14
@@ -699,15 +699,17 @@ static unsigned char *do_doctor(unsigned char *p, int count, struct dns_header *
|
|||||||
unsigned char *p2 = p1;
|
unsigned char *p2 = p1;
|
||||||
/* make counted string zero-term and sanitise */
|
/* make counted string zero-term and sanitise */
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
if (isprint(*(p2+1)))
|
{
|
||||||
{
|
if (!isprint((int)*(p2+1)))
|
||||||
*p2 = *(p2+1);
|
break;
|
||||||
p2++;
|
|
||||||
}
|
*p2 = *(p2+1);
|
||||||
|
p2++;
|
||||||
|
}
|
||||||
*p2 = 0;
|
*p2 = 0;
|
||||||
my_syslog(LOG_INFO, "reply %s is %s", name, p1);
|
my_syslog(LOG_INFO, "reply %s is %s", name, p1);
|
||||||
/* restore */
|
/* restore */
|
||||||
memmove(p1 + 1, p1, len);
|
memmove(p1 + 1, p1, i);
|
||||||
*p1 = len;
|
*p1 = len;
|
||||||
p1 += len+1;
|
p1 += len+1;
|
||||||
}
|
}
|
||||||
@@ -936,10 +938,14 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
|
|||||||
if (!cname_count--)
|
if (!cname_count--)
|
||||||
return 0; /* looped CNAMES */
|
return 0; /* looped CNAMES */
|
||||||
newc = cache_insert(name, NULL, now, attl, F_CNAME | F_FORWARD);
|
newc = cache_insert(name, NULL, now, attl, F_CNAME | F_FORWARD);
|
||||||
if (newc && cpp)
|
if (newc)
|
||||||
{
|
{
|
||||||
cpp->addr.cname.cache = newc;
|
newc->addr.cname.cache = NULL;
|
||||||
cpp->addr.cname.uid = newc->uid;
|
if (cpp)
|
||||||
|
{
|
||||||
|
cpp->addr.cname.cache = newc;
|
||||||
|
cpp->addr.cname.uid = newc->uid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cpp = newc;
|
cpp = newc;
|
||||||
@@ -1003,10 +1009,16 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't put stuff from a truncated packet into the cache,
|
/* Don't put stuff from a truncated packet into the cache.
|
||||||
also don't cache replies where DNSSEC validation was turned off, either
|
Don't cache replies where DNSSEC validation was turned off, either
|
||||||
the upstream server told us so, or the original query specified it. */
|
the upstream server told us so, or the original query specified it.
|
||||||
if (!(header->hb3 & HB3_TC) && !(header->hb4 & HB4_CD) && !checking_disabled)
|
Don't cache replies from non-recursive nameservers, since we may get a
|
||||||
|
reply containing a CNAME but not its target, even though the target
|
||||||
|
does exist. */
|
||||||
|
if (!(header->hb3 & HB3_TC) &&
|
||||||
|
!(header->hb4 & HB4_CD) &&
|
||||||
|
(header->hb4 & HB4_RA) &&
|
||||||
|
!checking_disabled)
|
||||||
cache_end_insert();
|
cache_end_insert();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1238,7 +1250,8 @@ static int add_resource_record(struct dns_header *header, char *limit, int *trun
|
|||||||
case 't':
|
case 't':
|
||||||
usval = va_arg(ap, int);
|
usval = va_arg(ap, int);
|
||||||
sval = va_arg(ap, char *);
|
sval = va_arg(ap, char *);
|
||||||
memcpy(p, sval, usval);
|
if (usval != 0)
|
||||||
|
memcpy(p, sval, usval);
|
||||||
p += usval;
|
p += usval;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1381,6 +1394,22 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
|
|
||||||
if (qclass == C_IN)
|
if (qclass == C_IN)
|
||||||
{
|
{
|
||||||
|
struct txt_record *t;
|
||||||
|
|
||||||
|
for (t = daemon->rr; t; t = t->next)
|
||||||
|
if ((t->class == qtype || qtype == T_ANY) && hostname_isequal(name, t->name))
|
||||||
|
{
|
||||||
|
ans = 1;
|
||||||
|
if (!dryrun)
|
||||||
|
{
|
||||||
|
log_query(F_CONFIG | F_RRNAME, name, NULL, "<RR>");
|
||||||
|
if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
||||||
|
daemon->local_ttl, NULL,
|
||||||
|
t->class, C_IN, "t", t->len, t->txt))
|
||||||
|
anscount ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (qtype == T_PTR || qtype == T_ANY)
|
if (qtype == T_PTR || qtype == T_ANY)
|
||||||
{
|
{
|
||||||
/* see if it's w.z.y.z.in-addr.arpa format */
|
/* see if it's w.z.y.z.in-addr.arpa format */
|
||||||
@@ -1633,6 +1662,23 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
} while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME)));
|
} while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (qtype == T_CNAME || qtype == T_ANY)
|
||||||
|
{
|
||||||
|
if ((crecp = cache_find_by_name(NULL, name, now, F_CNAME)) &&
|
||||||
|
(qtype == T_CNAME || (crecp->flags & (F_HOSTS | F_DHCP))))
|
||||||
|
{
|
||||||
|
ans = 1;
|
||||||
|
if (!dryrun)
|
||||||
|
{
|
||||||
|
log_query(crecp->flags, name, NULL, record_source(crecp->uid));
|
||||||
|
if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
||||||
|
crec_ttl(crecp, now), &nameoffset,
|
||||||
|
T_CNAME, C_IN, "d", cache_get_name(crecp->addr.cname.cache)))
|
||||||
|
anscount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (qtype == T_MX || qtype == T_ANY)
|
if (qtype == T_MX || qtype == T_ANY)
|
||||||
{
|
{
|
||||||
|
|||||||
+48
-42
@@ -483,7 +483,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
|
|||||||
{
|
{
|
||||||
logaddr = &mess->yiaddr;
|
logaddr = &mess->yiaddr;
|
||||||
|
|
||||||
lease_set_hwaddr(lease, mess->chaddr, NULL, mess->hlen, mess->htype, 0, now);
|
lease_set_hwaddr(lease, mess->chaddr, NULL, mess->hlen, mess->htype, 0, now, 1);
|
||||||
if (hostname)
|
if (hostname)
|
||||||
lease_set_hostname(lease, hostname, 1, get_domain(lease->addr), domain);
|
lease_set_hostname(lease, hostname, 1, get_domain(lease->addr), domain);
|
||||||
/* infinite lease unless nailed in dhcp-host line. */
|
/* infinite lease unless nailed in dhcp-host line. */
|
||||||
@@ -1222,51 +1222,56 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
|
|||||||
|
|
||||||
log_tags(tagif_netid, ntohl(mess->xid));
|
log_tags(tagif_netid, ntohl(mess->xid));
|
||||||
|
|
||||||
#ifdef HAVE_SCRIPT
|
if (do_classes)
|
||||||
if (do_classes && daemon->lease_change_command)
|
|
||||||
{
|
{
|
||||||
struct dhcp_netid *n;
|
/* pick up INIT-REBOOT events. */
|
||||||
|
|
||||||
if (mess->giaddr.s_addr)
|
|
||||||
lease->giaddr = mess->giaddr;
|
|
||||||
|
|
||||||
lease->flags |= LEASE_CHANGED;
|
lease->flags |= LEASE_CHANGED;
|
||||||
free(lease->extradata);
|
|
||||||
lease->extradata = NULL;
|
|
||||||
lease->extradata_size = lease->extradata_len = 0;
|
|
||||||
|
|
||||||
add_extradata_opt(lease, option_find(mess, sz, OPTION_VENDOR_ID, 1));
|
|
||||||
add_extradata_opt(lease, option_find(mess, sz, OPTION_HOSTNAME, 1));
|
|
||||||
add_extradata_opt(lease, oui);
|
|
||||||
add_extradata_opt(lease, serial);
|
|
||||||
add_extradata_opt(lease, class);
|
|
||||||
|
|
||||||
/* space-concat tag set */
|
|
||||||
if (!tagif_netid)
|
|
||||||
add_extradata_opt(lease, NULL);
|
|
||||||
else
|
|
||||||
for (n = tagif_netid; n; n = n->next)
|
|
||||||
{
|
|
||||||
struct dhcp_netid *n1;
|
|
||||||
/* kill dupes */
|
|
||||||
for (n1 = n->next; n1; n1 = n1->next)
|
|
||||||
if (strcmp(n->net, n1->net) == 0)
|
|
||||||
break;
|
|
||||||
if (!n1)
|
|
||||||
lease_add_extradata(lease, (unsigned char *)n->net, strlen(n->net), n->next ? ' ' : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((opt = option_find(mess, sz, OPTION_USER_CLASS, 1)))
|
#ifdef HAVE_SCRIPT
|
||||||
|
if (daemon->lease_change_command)
|
||||||
{
|
{
|
||||||
int len = option_len(opt);
|
struct dhcp_netid *n;
|
||||||
unsigned char *ucp = option_ptr(opt, 0);
|
|
||||||
/* If the user-class option started as counted strings, the first byte will be zero. */
|
if (mess->giaddr.s_addr)
|
||||||
if (len != 0 && ucp[0] == 0)
|
lease->giaddr = mess->giaddr;
|
||||||
ucp++, len--;
|
|
||||||
lease_add_extradata(lease, ucp, len, 0);
|
free(lease->extradata);
|
||||||
|
lease->extradata = NULL;
|
||||||
|
lease->extradata_size = lease->extradata_len = 0;
|
||||||
|
|
||||||
|
add_extradata_opt(lease, option_find(mess, sz, OPTION_VENDOR_ID, 1));
|
||||||
|
add_extradata_opt(lease, option_find(mess, sz, OPTION_HOSTNAME, 1));
|
||||||
|
add_extradata_opt(lease, oui);
|
||||||
|
add_extradata_opt(lease, serial);
|
||||||
|
add_extradata_opt(lease, class);
|
||||||
|
|
||||||
|
/* space-concat tag set */
|
||||||
|
if (!tagif_netid)
|
||||||
|
add_extradata_opt(lease, NULL);
|
||||||
|
else
|
||||||
|
for (n = tagif_netid; n; n = n->next)
|
||||||
|
{
|
||||||
|
struct dhcp_netid *n1;
|
||||||
|
/* kill dupes */
|
||||||
|
for (n1 = n->next; n1; n1 = n1->next)
|
||||||
|
if (strcmp(n->net, n1->net) == 0)
|
||||||
|
break;
|
||||||
|
if (!n1)
|
||||||
|
lease_add_extradata(lease, (unsigned char *)n->net, strlen(n->net), n->next ? ' ' : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((opt = option_find(mess, sz, OPTION_USER_CLASS, 1)))
|
||||||
|
{
|
||||||
|
int len = option_len(opt);
|
||||||
|
unsigned char *ucp = option_ptr(opt, 0);
|
||||||
|
/* If the user-class option started as counted strings, the first byte will be zero. */
|
||||||
|
if (len != 0 && ucp[0] == 0)
|
||||||
|
ucp++, len--;
|
||||||
|
lease_add_extradata(lease, ucp, len, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (!hostname_auth && (client_hostname = host_from_dns(mess->yiaddr)))
|
if (!hostname_auth && (client_hostname = host_from_dns(mess->yiaddr)))
|
||||||
{
|
{
|
||||||
@@ -1276,7 +1281,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
time = calc_time(context, config, option_find(mess, sz, OPTION_LEASE_TIME, 4));
|
time = calc_time(context, config, option_find(mess, sz, OPTION_LEASE_TIME, 4));
|
||||||
lease_set_hwaddr(lease, mess->chaddr, clid, mess->hlen, mess->htype, clid_len, now);
|
lease_set_hwaddr(lease, mess->chaddr, clid, mess->hlen, mess->htype, clid_len, now, do_classes);
|
||||||
|
|
||||||
/* if all the netids in the ignore_name list are present, ignore client-supplied name */
|
/* if all the netids in the ignore_name list are present, ignore client-supplied name */
|
||||||
if (!hostname_auth)
|
if (!hostname_auth)
|
||||||
@@ -2095,7 +2100,8 @@ static void do_options(struct dhcp_context *context,
|
|||||||
struct dhcp_netid_list *id_list;
|
struct dhcp_netid_list *id_list;
|
||||||
|
|
||||||
/* filter options based on tags, those we want get DHOPT_TAGOK bit set */
|
/* filter options based on tags, those we want get DHOPT_TAGOK bit set */
|
||||||
context->netid.next = NULL;
|
if (context)
|
||||||
|
context->netid.next = NULL;
|
||||||
tagif = option_filter(netid, context && context->netid.net ? &context->netid : NULL, config_opts);
|
tagif = option_filter(netid, context && context->netid.net ? &context->netid : NULL, config_opts);
|
||||||
|
|
||||||
/* logging */
|
/* logging */
|
||||||
|
|||||||
+44
-39
@@ -349,28 +349,28 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
|
|
||||||
if (len != 0 && len < 255)
|
if (len != 0 && len < 255)
|
||||||
{
|
{
|
||||||
unsigned char *pp, *op = opt6_ptr(opt, 1);
|
unsigned char *pp, *op = opt6_ptr(opt, 1);
|
||||||
char *pq = daemon->dhcp_buff;
|
char *pq = daemon->dhcp_buff;
|
||||||
|
|
||||||
pp = op;
|
pp = op;
|
||||||
while (*op != 0 && ((op + (*op) + 1) - pp) < len)
|
while (*op != 0 && ((op + (*op)) - pp) < len)
|
||||||
{
|
{
|
||||||
memcpy(pq, op+1, *op);
|
memcpy(pq, op+1, *op);
|
||||||
pq += *op;
|
pq += *op;
|
||||||
op += (*op)+1;
|
op += (*op)+1;
|
||||||
*(pq++) = '.';
|
*(pq++) = '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pq != daemon->dhcp_buff)
|
if (pq != daemon->dhcp_buff)
|
||||||
pq--;
|
pq--;
|
||||||
*pq = 0;
|
*pq = 0;
|
||||||
|
|
||||||
if (legal_hostname(daemon->dhcp_buff))
|
if (legal_hostname(daemon->dhcp_buff))
|
||||||
{
|
{
|
||||||
client_hostname = daemon->dhcp_buff;
|
client_hostname = daemon->dhcp_buff;
|
||||||
if (option_bool(OPT_LOG_OPTS))
|
if (option_bool(OPT_LOG_OPTS))
|
||||||
my_syslog(MS_DHCP | LOG_INFO, _("%u client provides name: %s"), xid, client_hostname);
|
my_syslog(MS_DHCP | LOG_INFO, _("%u client provides name: %s"), xid, client_hostname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,13 +513,13 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
struct in6_addr alloced_addr, *addrp = NULL;
|
struct in6_addr alloced_addr, *addrp = NULL;
|
||||||
u32 preferred_time = 0;
|
u32 requested_time = 0;
|
||||||
struct dhcp_lease *lease = NULL;
|
struct dhcp_lease *lease = NULL;
|
||||||
|
|
||||||
if (ia_option)
|
if (ia_option)
|
||||||
{
|
{
|
||||||
struct in6_addr *req_addr = opt6_ptr(ia_option, 0);
|
struct in6_addr *req_addr = opt6_ptr(ia_option, 0);
|
||||||
preferred_time = opt6_uint(ia_option, 16, 4);
|
requested_time = opt6_uint(ia_option, 16, 4);
|
||||||
|
|
||||||
if (!address6_available(context, req_addr, tags) &&
|
if (!address6_available(context, req_addr, tags) &&
|
||||||
(!have_config(config, CONFIG_ADDR6) || memcmp(&config->addr6, req_addr, IN6ADDRSZ) != 0))
|
(!have_config(config, CONFIG_ADDR6) || memcmp(&config->addr6, req_addr, IN6ADDRSZ) != 0))
|
||||||
@@ -621,10 +621,10 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
|
|
||||||
if (ia_option)
|
if (ia_option)
|
||||||
{
|
{
|
||||||
if (preferred_time < 120u )
|
if (requested_time < 120u )
|
||||||
preferred_time = 120u; /* sanity */
|
requested_time = 120u; /* sanity */
|
||||||
if (lease_time == 0xffffffff || (preferred_time != 0xffffffff && preferred_time < lease_time))
|
if (lease_time == 0xffffffff || (requested_time != 0xffffffff && requested_time < lease_time))
|
||||||
lease_time = preferred_time;
|
lease_time = requested_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lease_time < min_time)
|
if (lease_time < min_time)
|
||||||
@@ -637,7 +637,7 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
if (lease)
|
if (lease)
|
||||||
{
|
{
|
||||||
lease_set_expires(lease, lease_time, now);
|
lease_set_expires(lease, lease_time, now);
|
||||||
lease_set_hwaddr(lease, NULL, clid, 0, iaid, clid_len, now);
|
lease_set_hwaddr(lease, NULL, clid, 0, iaid, clid_len, now, 0);
|
||||||
lease_set_interface(lease, interface, now);
|
lease_set_interface(lease, interface, now);
|
||||||
if (hostname && ia_type == OPTION6_IA_NA)
|
if (hostname && ia_type == OPTION6_IA_NA)
|
||||||
{
|
{
|
||||||
@@ -730,8 +730,9 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
{
|
{
|
||||||
o1 = new_opt6(OPTION6_IAADDR);
|
o1 = new_opt6(OPTION6_IAADDR);
|
||||||
put_opt6(addrp, sizeof(*addrp));
|
put_opt6(addrp, sizeof(*addrp));
|
||||||
put_opt6_long(lease_time);
|
/* preferred lifetime */
|
||||||
put_opt6_long(lease_time);
|
put_opt6_long(this_context && (this_context->flags & CONTEXT_DEPRECATE) ? 0 : lease_time);
|
||||||
|
put_opt6_long(lease_time); /* valid lifetime */
|
||||||
end_opt6(o1);
|
end_opt6(o1);
|
||||||
|
|
||||||
log6_packet( make_lease ? "DHCPREPLY" : "DHCPADVERTISE",
|
log6_packet( make_lease ? "DHCPREPLY" : "DHCPADVERTISE",
|
||||||
@@ -842,7 +843,7 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
{
|
{
|
||||||
struct dhcp_lease *lease = NULL;
|
struct dhcp_lease *lease = NULL;
|
||||||
struct in6_addr *req_addr = opt6_ptr(ia_option, 0);
|
struct in6_addr *req_addr = opt6_ptr(ia_option, 0);
|
||||||
u32 preferred_time = opt6_uint(ia_option, 16, 4);
|
u32 requested_time = opt6_uint(ia_option, 16, 4);
|
||||||
unsigned int lease_time;
|
unsigned int lease_time;
|
||||||
struct dhcp_context *this_context;
|
struct dhcp_context *this_context;
|
||||||
struct dhcp_config *valid_config = config;
|
struct dhcp_config *valid_config = config;
|
||||||
@@ -873,7 +874,10 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
|
|
||||||
if (!address6_available(context, req_addr, tagif) ||
|
if (!address6_available(context, req_addr, tagif) ||
|
||||||
!(this_context = narrow_context6(context, req_addr, tagif)))
|
!(this_context = narrow_context6(context, req_addr, tagif)))
|
||||||
lease_time = 0;
|
{
|
||||||
|
lease_time = 0;
|
||||||
|
this_context = NULL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* get tags from context if we've not used it before */
|
/* get tags from context if we've not used it before */
|
||||||
@@ -895,10 +899,10 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
|
|
||||||
lease_time = have_config(valid_config, CONFIG_TIME) ? valid_config->lease_time : this_context->lease_time;
|
lease_time = have_config(valid_config, CONFIG_TIME) ? valid_config->lease_time : this_context->lease_time;
|
||||||
|
|
||||||
if (preferred_time < 120u )
|
if (requested_time < 120u )
|
||||||
preferred_time = 120u; /* sanity */
|
requested_time = 120u; /* sanity */
|
||||||
if (lease_time == 0xffffffff || (preferred_time != 0xffffffff && preferred_time < lease_time))
|
if (lease_time == 0xffffffff || (requested_time != 0xffffffff && requested_time < lease_time))
|
||||||
lease_time = preferred_time;
|
lease_time = requested_time;
|
||||||
|
|
||||||
lease_set_expires(lease, lease_time, now);
|
lease_set_expires(lease, lease_time, now);
|
||||||
if (ia_type == OPTION6_IA_NA && hostname)
|
if (ia_type == OPTION6_IA_NA && hostname)
|
||||||
@@ -917,8 +921,9 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
|
|||||||
|
|
||||||
o1 = new_opt6(OPTION6_IAADDR);
|
o1 = new_opt6(OPTION6_IAADDR);
|
||||||
put_opt6(req_addr, sizeof(*req_addr));
|
put_opt6(req_addr, sizeof(*req_addr));
|
||||||
put_opt6_long(lease_time);
|
/* preferred lifetime */
|
||||||
put_opt6_long(lease_time);
|
put_opt6_long(this_context && (this_context->flags & CONTEXT_DEPRECATE) ? 0 : lease_time);
|
||||||
|
put_opt6_long(lease_time); /* valid lifetime */
|
||||||
end_opt6(o1);
|
end_opt6(o1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-14
@@ -23,12 +23,14 @@
|
|||||||
static int map_rebuild = 0;
|
static int map_rebuild = 0;
|
||||||
static int ping_id = 0;
|
static int ping_id = 0;
|
||||||
|
|
||||||
void slaac_add_addrs(struct dhcp_lease *lease, time_t now)
|
void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force)
|
||||||
{
|
{
|
||||||
struct slaac_address *slaac, *old, **up;
|
struct slaac_address *slaac, *old, **up;
|
||||||
struct dhcp_context *context;
|
struct dhcp_context *context;
|
||||||
|
int dns_dirty = 0;
|
||||||
|
|
||||||
if (!(lease->flags & LEASE_HAVE_HWADDR) ||
|
if (!(lease->flags & LEASE_HAVE_HWADDR) ||
|
||||||
|
(lease->flags & (LEASE_TA | LEASE_NA)) ||
|
||||||
lease->last_interface == 0 ||
|
lease->last_interface == 0 ||
|
||||||
!lease->hostname)
|
!lease->hostname)
|
||||||
return ;
|
return ;
|
||||||
@@ -72,6 +74,13 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now)
|
|||||||
if (IN6_ARE_ADDR_EQUAL(&addr, &slaac->addr))
|
if (IN6_ARE_ADDR_EQUAL(&addr, &slaac->addr))
|
||||||
{
|
{
|
||||||
*up = slaac->next;
|
*up = slaac->next;
|
||||||
|
/* recheck when DHCPv4 goes through init-reboot */
|
||||||
|
if (force)
|
||||||
|
{
|
||||||
|
slaac->ping_time = now;
|
||||||
|
slaac->backoff = 1;
|
||||||
|
dns_dirty = 1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
up = &slaac->next;
|
up = &slaac->next;
|
||||||
@@ -95,6 +104,9 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (old || dns_dirty)
|
||||||
|
lease_update_dns(1);
|
||||||
|
|
||||||
/* Free any no reused */
|
/* Free any no reused */
|
||||||
for (; old; old = slaac)
|
for (; old; old = slaac)
|
||||||
{
|
{
|
||||||
@@ -108,8 +120,8 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases)
|
|||||||
{
|
{
|
||||||
struct dhcp_context *context;
|
struct dhcp_context *context;
|
||||||
struct dhcp_lease *lease;
|
struct dhcp_lease *lease;
|
||||||
struct slaac_address *slaac;
|
struct slaac_address *slaac;
|
||||||
time_t next_event = 0;
|
time_t next_event = 0;
|
||||||
|
|
||||||
for (context = daemon->ra_contexts; context; context = context->next)
|
for (context = daemon->ra_contexts; context; context = context->next)
|
||||||
if ((context->flags & CONTEXT_RA_NAME))
|
if ((context->flags & CONTEXT_RA_NAME))
|
||||||
@@ -131,15 +143,15 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases)
|
|||||||
for (lease = leases; lease; lease = lease->next)
|
for (lease = leases; lease; lease = lease->next)
|
||||||
for (slaac = lease->slaac_address; slaac; slaac = slaac->next)
|
for (slaac = lease->slaac_address; slaac; slaac = slaac->next)
|
||||||
{
|
{
|
||||||
/* confirmed? */
|
/* confirmed or given up? */
|
||||||
if (slaac->backoff == 0)
|
if (slaac->backoff == 0 || slaac->ping_time == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (difftime(slaac->ping_time, now) <= 0.0)
|
if (difftime(slaac->ping_time, now) <= 0.0)
|
||||||
{
|
{
|
||||||
struct ping_packet *ping;
|
struct ping_packet *ping;
|
||||||
struct sockaddr_in6 addr;
|
struct sockaddr_in6 addr;
|
||||||
|
|
||||||
save_counter(0);
|
save_counter(0);
|
||||||
ping = expand(sizeof(struct ping_packet));
|
ping = expand(sizeof(struct ping_packet));
|
||||||
ping->type = ICMP6_ECHO_REQUEST;
|
ping->type = ICMP6_ECHO_REQUEST;
|
||||||
@@ -155,16 +167,22 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases)
|
|||||||
addr.sin6_port = htons(IPPROTO_ICMPV6);
|
addr.sin6_port = htons(IPPROTO_ICMPV6);
|
||||||
addr.sin6_addr = slaac->addr;
|
addr.sin6_addr = slaac->addr;
|
||||||
|
|
||||||
send_from(daemon->icmp6fd, 0, daemon->outpacket.iov_base, save_counter(0),
|
if (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(0), 0,
|
||||||
(union mysockaddr *)&addr, (struct all_addr *)&slaac->local, lease->last_interface);
|
(struct sockaddr *)&addr, sizeof(addr)) == -1 &&
|
||||||
|
errno == EHOSTUNREACH)
|
||||||
slaac->ping_time += (1 << (slaac->backoff - 1)) + (rand16()/21785); /* 0 - 3 */
|
slaac->ping_time = 0; /* Give up */
|
||||||
if (slaac->backoff > 4)
|
else
|
||||||
slaac->ping_time += rand16()/4000; /* 0 - 15 */
|
{
|
||||||
slaac->backoff++;
|
slaac->ping_time += (1 << (slaac->backoff - 1)) + (rand16()/21785); /* 0 - 3 */
|
||||||
|
if (slaac->backoff > 4)
|
||||||
|
slaac->ping_time += rand16()/4000; /* 0 - 15 */
|
||||||
|
if (slaac->backoff < 12)
|
||||||
|
slaac->backoff++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next_event == 0 || difftime(next_event, slaac->ping_time) >= 0.0)
|
if (slaac->ping_time != 0 &&
|
||||||
|
(next_event == 0 || difftime(next_event, slaac->ping_time) >= 0.0))
|
||||||
next_event = slaac->ping_time;
|
next_event = slaac->ping_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+84
-73
@@ -18,12 +18,13 @@
|
|||||||
|
|
||||||
#ifdef HAVE_TFTP
|
#ifdef HAVE_TFTP
|
||||||
|
|
||||||
static struct tftp_file *check_tftp_fileperm(ssize_t *len, char *prefix, int special);
|
static struct tftp_file *check_tftp_fileperm(ssize_t *len, char *prefix);
|
||||||
static void free_transfer(struct tftp_transfer *transfer);
|
static void free_transfer(struct tftp_transfer *transfer);
|
||||||
static ssize_t tftp_err(int err, char *packet, char *mess, char *file);
|
static ssize_t tftp_err(int err, char *packet, char *mess, char *file);
|
||||||
static ssize_t tftp_err_oops(char *packet, char *file);
|
static ssize_t tftp_err_oops(char *packet, char *file);
|
||||||
static ssize_t get_block(char *packet, struct tftp_transfer *transfer);
|
static ssize_t get_block(char *packet, struct tftp_transfer *transfer);
|
||||||
static char *next(char **p, char *end);
|
static char *next(char **p, char *end);
|
||||||
|
static void sanitise(char *buf);
|
||||||
|
|
||||||
#define OP_RRQ 1
|
#define OP_RRQ 1
|
||||||
#define OP_WRQ 2
|
#define OP_WRQ 2
|
||||||
@@ -47,7 +48,7 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
struct msghdr msg;
|
struct msghdr msg;
|
||||||
struct iovec iov;
|
struct iovec iov;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
int is_err = 1, if_index = 0, mtu = 0, special = 0;
|
int is_err = 1, if_index = 0, mtu = 0;
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
struct iname *tmp;
|
struct iname *tmp;
|
||||||
#endif
|
#endif
|
||||||
@@ -57,10 +58,9 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
int mtuflag = IP_PMTUDISC_DONT;
|
int mtuflag = IP_PMTUDISC_DONT;
|
||||||
#endif
|
#endif
|
||||||
char namebuff[IF_NAMESIZE];
|
char namebuff[IF_NAMESIZE];
|
||||||
char *name;
|
char *name = NULL;
|
||||||
char *prefix = daemon->tftp_prefix;
|
char *prefix = daemon->tftp_prefix;
|
||||||
struct tftp_prefix *pref;
|
struct tftp_prefix *pref;
|
||||||
struct interface_list *ir;
|
|
||||||
|
|
||||||
union {
|
union {
|
||||||
struct cmsghdr align; /* this ensures alignment */
|
struct cmsghdr align; /* this ensures alignment */
|
||||||
@@ -95,15 +95,25 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
|
|
||||||
if (option_bool(OPT_NOWILD))
|
if (option_bool(OPT_NOWILD))
|
||||||
{
|
{
|
||||||
addr = listen->iface->addr;
|
if (listen->iface)
|
||||||
mtu = listen->iface->mtu;
|
{
|
||||||
name = listen->iface->name;
|
addr = listen->iface->addr;
|
||||||
|
mtu = listen->iface->mtu;
|
||||||
|
name = listen->iface->name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* we're listening on an address that doesn't appear on an interface,
|
||||||
|
ask the kernel what the socket is bound to */
|
||||||
|
socklen_t tcp_len = sizeof(union mysockaddr);
|
||||||
|
if (getsockname(listen->tftpfd, (struct sockaddr *)&addr, &tcp_len) == -1)
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct cmsghdr *cmptr;
|
struct cmsghdr *cmptr;
|
||||||
int check;
|
int check;
|
||||||
struct interface_list *ir;
|
|
||||||
|
|
||||||
if (msg.msg_controllen < sizeof(struct cmsghdr))
|
if (msg.msg_controllen < sizeof(struct cmsghdr))
|
||||||
return;
|
return;
|
||||||
@@ -188,38 +198,25 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
#endif
|
#endif
|
||||||
check = iface_check(AF_INET, (struct all_addr *)&addr.in.sin_addr, name);
|
check = iface_check(AF_INET, (struct all_addr *)&addr.in.sin_addr, name);
|
||||||
|
|
||||||
/* wierd TFTP service override */
|
|
||||||
for (ir = daemon->tftp_interfaces; ir; ir = ir->next)
|
|
||||||
if (strcmp(ir->interface, name) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!ir)
|
|
||||||
{
|
|
||||||
if (!daemon->tftp_unlimited || !check)
|
|
||||||
return;
|
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
/* allowed interfaces are the same as for DHCP */
|
/* allowed interfaces are the same as for DHCP */
|
||||||
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
|
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
|
||||||
if (tmp->name && (strcmp(tmp->name, name) == 0))
|
if (tmp->name && (strcmp(tmp->name, name) == 0))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
strncpy(ifr.ifr_name, name, IF_NAMESIZE);
|
strncpy(ifr.ifr_name, name, IF_NAMESIZE);
|
||||||
if (ioctl(listen->tftpfd, SIOCGIFMTU, &ifr) != -1)
|
if (ioctl(listen->tftpfd, SIOCGIFMTU, &ifr) != -1)
|
||||||
mtu = ifr.ifr_mtu;
|
mtu = ifr.ifr_mtu;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for per-interface prefix */
|
if (name)
|
||||||
for (pref = daemon->if_prefix; pref; pref = pref->next)
|
{
|
||||||
if (strcmp(pref->interface, name) == 0)
|
/* check for per-interface prefix */
|
||||||
prefix = pref->prefix;
|
for (pref = daemon->if_prefix; pref; pref = pref->next)
|
||||||
|
if (strcmp(pref->interface, name) == 0)
|
||||||
/* wierd TFTP interfaces disable special options. */
|
prefix = pref->prefix;
|
||||||
for (ir = daemon->tftp_interfaces; ir; ir = ir->next)
|
}
|
||||||
if (strcmp(ir->interface, name) == 0)
|
|
||||||
special = 1;
|
|
||||||
|
|
||||||
if (listen->family == AF_INET)
|
if (listen->family == AF_INET)
|
||||||
{
|
{
|
||||||
@@ -297,7 +294,10 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
!(filename = next(&p, end)) ||
|
!(filename = next(&p, end)) ||
|
||||||
!(mode = next(&p, end)) ||
|
!(mode = next(&p, end)) ||
|
||||||
(strcasecmp(mode, "octet") != 0 && strcasecmp(mode, "netascii") != 0))
|
(strcasecmp(mode, "octet") != 0 && strcasecmp(mode, "netascii") != 0))
|
||||||
len = tftp_err(ERR_ILL, packet, _("unsupported request from %s"), daemon->addrbuff);
|
{
|
||||||
|
len = tftp_err(ERR_ILL, packet, _("unsupported request from %s"), daemon->addrbuff);
|
||||||
|
is_err = 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (strcasecmp(mode, "netascii") == 0)
|
if (strcasecmp(mode, "netascii") == 0)
|
||||||
@@ -307,8 +307,7 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
{
|
{
|
||||||
if (strcasecmp(opt, "blksize") == 0)
|
if (strcasecmp(opt, "blksize") == 0)
|
||||||
{
|
{
|
||||||
if ((opt = next(&p, end)) &&
|
if ((opt = next(&p, end)) && !option_bool(OPT_TFTP_NOBLOCK))
|
||||||
(special || !option_bool(OPT_TFTP_NOBLOCK)))
|
|
||||||
{
|
{
|
||||||
transfer->blocksize = atoi(opt);
|
transfer->blocksize = atoi(opt);
|
||||||
if (transfer->blocksize < 1)
|
if (transfer->blocksize < 1)
|
||||||
@@ -330,9 +329,12 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* cope with backslashes from windows boxen. */
|
/* cope with backslashes from windows boxen. */
|
||||||
while ((p = strchr(filename, '\\')))
|
for (p = filename; *p; p++)
|
||||||
*p = '/';
|
if (*p == '\\')
|
||||||
|
*p = '/';
|
||||||
|
else if (option_bool(OPT_TFTP_LC))
|
||||||
|
*p = tolower(*p);
|
||||||
|
|
||||||
strcpy(daemon->namebuff, "/");
|
strcpy(daemon->namebuff, "/");
|
||||||
if (prefix)
|
if (prefix)
|
||||||
{
|
{
|
||||||
@@ -342,7 +344,7 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
if (prefix[strlen(prefix)-1] != '/')
|
if (prefix[strlen(prefix)-1] != '/')
|
||||||
strncat(daemon->namebuff, "/", (MAXDNAME-1) - strlen(daemon->namebuff));
|
strncat(daemon->namebuff, "/", (MAXDNAME-1) - strlen(daemon->namebuff));
|
||||||
|
|
||||||
if (!special && option_bool(OPT_TFTP_APREF))
|
if (option_bool(OPT_TFTP_APREF))
|
||||||
{
|
{
|
||||||
size_t oldlen = strlen(daemon->namebuff);
|
size_t oldlen = strlen(daemon->namebuff);
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
@@ -369,7 +371,7 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
strncat(daemon->namebuff, filename, (MAXDNAME-1) - strlen(daemon->namebuff));
|
strncat(daemon->namebuff, filename, (MAXDNAME-1) - strlen(daemon->namebuff));
|
||||||
|
|
||||||
/* check permissions and open file */
|
/* check permissions and open file */
|
||||||
if ((transfer->file = check_tftp_fileperm(&len, prefix, special)))
|
if ((transfer->file = check_tftp_fileperm(&len, prefix)))
|
||||||
{
|
{
|
||||||
if ((len = get_block(packet, transfer)) == -1)
|
if ((len = get_block(packet, transfer)) == -1)
|
||||||
len = tftp_err_oops(packet, daemon->namebuff);
|
len = tftp_err_oops(packet, daemon->namebuff);
|
||||||
@@ -379,7 +381,7 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (sendto(transfer->sockfd, packet, len, 0,
|
while (sendto(transfer->sockfd, packet, len, 0,
|
||||||
(struct sockaddr *)&peer, sizeof(peer)) == -1 && errno == EINTR);
|
(struct sockaddr *)&peer, sa_len(&peer)) == -1 && errno == EINTR);
|
||||||
|
|
||||||
if (is_err)
|
if (is_err)
|
||||||
free_transfer(transfer);
|
free_transfer(transfer);
|
||||||
@@ -390,7 +392,7 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct tftp_file *check_tftp_fileperm(ssize_t *len, char *prefix, int special)
|
static struct tftp_file *check_tftp_fileperm(ssize_t *len, char *prefix)
|
||||||
{
|
{
|
||||||
char *packet = daemon->packet, *namebuff = daemon->namebuff;
|
char *packet = daemon->packet, *namebuff = daemon->namebuff;
|
||||||
struct tftp_file *file;
|
struct tftp_file *file;
|
||||||
@@ -427,7 +429,7 @@ static struct tftp_file *check_tftp_fileperm(ssize_t *len, char *prefix, int spe
|
|||||||
goto perm;
|
goto perm;
|
||||||
}
|
}
|
||||||
/* in secure mode, must be owned by user running dnsmasq */
|
/* in secure mode, must be owned by user running dnsmasq */
|
||||||
else if (!special && option_bool(OPT_TFTP_SECURE) && uid != statbuf.st_uid)
|
else if (option_bool(OPT_TFTP_SECURE) && uid != statbuf.st_uid)
|
||||||
goto perm;
|
goto perm;
|
||||||
|
|
||||||
/* If we're doing many tranfers from the same file, only
|
/* If we're doing many tranfers from the same file, only
|
||||||
@@ -487,12 +489,12 @@ void check_tftp_listeners(fd_set *rset, time_t now)
|
|||||||
{
|
{
|
||||||
tmp = transfer->next;
|
tmp = transfer->next;
|
||||||
|
|
||||||
|
prettyprint_addr(&transfer->peer, daemon->addrbuff);
|
||||||
|
|
||||||
if (FD_ISSET(transfer->sockfd, rset))
|
if (FD_ISSET(transfer->sockfd, rset))
|
||||||
{
|
{
|
||||||
/* we overwrote the buffer... */
|
/* we overwrote the buffer... */
|
||||||
daemon->srv_save = NULL;
|
daemon->srv_save = NULL;
|
||||||
|
|
||||||
prettyprint_addr(&transfer->peer, daemon->addrbuff);
|
|
||||||
|
|
||||||
if ((len = recv(transfer->sockfd, daemon->packet, daemon->packet_buff_sz, 0)) >= (ssize_t)sizeof(struct ack))
|
if ((len = recv(transfer->sockfd, daemon->packet, daemon->packet_buff_sz, 0)) >= (ssize_t)sizeof(struct ack))
|
||||||
{
|
{
|
||||||
@@ -514,14 +516,8 @@ void check_tftp_listeners(fd_set *rset, time_t now)
|
|||||||
if (!err)
|
if (!err)
|
||||||
err = "";
|
err = "";
|
||||||
else
|
else
|
||||||
{
|
sanitise(err);
|
||||||
unsigned char *q, *r;
|
|
||||||
for (q = r = (unsigned char *)err; *r; r++)
|
|
||||||
if (isprint(*r))
|
|
||||||
*(q++) = *r;
|
|
||||||
*q = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
my_syslog(MS_TFTP | LOG_ERR, _("error %d %s received from %s"),
|
my_syslog(MS_TFTP | LOG_ERR, _("error %d %s received from %s"),
|
||||||
(int)ntohs(mess->block), err,
|
(int)ntohs(mess->block), err,
|
||||||
daemon->addrbuff);
|
daemon->addrbuff);
|
||||||
@@ -548,32 +544,33 @@ void check_tftp_listeners(fd_set *rset, time_t now)
|
|||||||
len = tftp_err_oops(daemon->packet, transfer->file->filename);
|
len = tftp_err_oops(daemon->packet, transfer->file->filename);
|
||||||
endcon = 1;
|
endcon = 1;
|
||||||
}
|
}
|
||||||
else if (++transfer->backoff > 5)
|
/* don't complain about timeout when we're awaiting the last
|
||||||
|
ACK, some clients never send it */
|
||||||
|
else if (++transfer->backoff > 5 && len != 0)
|
||||||
{
|
{
|
||||||
/* don't complain about timeout when we're awaiting the last
|
endcon = 1;
|
||||||
ACK, some clients never send it */
|
len = 0;
|
||||||
if (len != 0)
|
|
||||||
{
|
|
||||||
my_syslog(MS_TFTP | LOG_ERR, _("failed sending %s to %s"),
|
|
||||||
transfer->file->filename, daemon->addrbuff);
|
|
||||||
len = 0;
|
|
||||||
endcon = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len != 0)
|
if (len != 0)
|
||||||
while(sendto(transfer->sockfd, daemon->packet, len, 0,
|
while(sendto(transfer->sockfd, daemon->packet, len, 0,
|
||||||
(struct sockaddr *)&transfer->peer, sizeof(transfer->peer)) == -1 && errno == EINTR);
|
(struct sockaddr *)&transfer->peer, sa_len(&transfer->peer)) == -1 && errno == EINTR);
|
||||||
|
|
||||||
if (endcon || len == 0)
|
if (endcon || len == 0)
|
||||||
{
|
{
|
||||||
if (!endcon)
|
strcpy(daemon->namebuff, transfer->file->filename);
|
||||||
my_syslog(MS_TFTP | LOG_INFO, _("sent %s to %s"), transfer->file->filename, daemon->addrbuff);
|
sanitise(daemon->namebuff);
|
||||||
|
my_syslog(MS_TFTP | LOG_INFO, endcon ? _("failed sending %s to %s") : _("sent %s to %s"), daemon->namebuff, daemon->addrbuff);
|
||||||
/* unlink */
|
/* unlink */
|
||||||
*up = tmp;
|
*up = tmp;
|
||||||
/* put on queue to be sent to script and deleted */
|
if (endcon)
|
||||||
transfer->next = daemon->tftp_done_trans;
|
free_transfer(transfer);
|
||||||
daemon->tftp_done_trans = transfer;
|
else
|
||||||
|
{
|
||||||
|
/* put on queue to be sent to script and deleted */
|
||||||
|
transfer->next = daemon->tftp_done_trans;
|
||||||
|
daemon->tftp_done_trans = transfer;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -607,6 +604,16 @@ static char *next(char **p, char *end)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sanitise(char *buf)
|
||||||
|
{
|
||||||
|
unsigned char *q, *r;
|
||||||
|
for (q = r = (unsigned char *)buf; *r; r++)
|
||||||
|
if (isprint((int)*r))
|
||||||
|
*(q++) = *r;
|
||||||
|
*q = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static ssize_t tftp_err(int err, char *packet, char *message, char *file)
|
static ssize_t tftp_err(int err, char *packet, char *message, char *file)
|
||||||
{
|
{
|
||||||
struct errmess {
|
struct errmess {
|
||||||
@@ -615,7 +622,9 @@ static ssize_t tftp_err(int err, char *packet, char *message, char *file)
|
|||||||
} *mess = (struct errmess *)packet;
|
} *mess = (struct errmess *)packet;
|
||||||
ssize_t ret = 4;
|
ssize_t ret = 4;
|
||||||
char *errstr = strerror(errno);
|
char *errstr = strerror(errno);
|
||||||
|
|
||||||
|
sanitise(file);
|
||||||
|
|
||||||
mess->op = htons(OP_ERR);
|
mess->op = htons(OP_ERR);
|
||||||
mess->err = htons(err);
|
mess->err = htons(err);
|
||||||
ret += (snprintf(mess->message, 500, message, file, errstr) + 1);
|
ret += (snprintf(mess->message, 500, message, file, errstr) + 1);
|
||||||
@@ -626,7 +635,9 @@ static ssize_t tftp_err(int err, char *packet, char *message, char *file)
|
|||||||
|
|
||||||
static ssize_t tftp_err_oops(char *packet, char *file)
|
static ssize_t tftp_err_oops(char *packet, char *file)
|
||||||
{
|
{
|
||||||
return tftp_err(ERR_NOTDEF, packet, _("cannot read %s: %s"), file);
|
/* May have >1 refs to file, so potentially mangle a copy of the name */
|
||||||
|
strcpy(daemon->namebuff, file);
|
||||||
|
return tftp_err(ERR_NOTDEF, packet, _("cannot read %s: %s"), daemon->namebuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return -1 for error, zero for done. */
|
/* return -1 for error, zero for done. */
|
||||||
|
|||||||
+23
-6
@@ -330,7 +330,7 @@ int is_same_net6(struct in6_addr *a, struct in6_addr *b, int prefixlen)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (pfbits == 0 ||
|
if (pfbits == 0 ||
|
||||||
(a->s6_addr[pfbytes] >> (8 - pfbits) != b->s6_addr[pfbytes] >> (8 - pfbits)))
|
(a->s6_addr[pfbytes] >> (8 - pfbits) == b->s6_addr[pfbytes] >> (8 - pfbits)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -426,7 +426,7 @@ int parse_hex(char *in, unsigned char *out, int maxlen,
|
|||||||
|
|
||||||
while (maxlen == -1 || i < maxlen)
|
while (maxlen == -1 || i < maxlen)
|
||||||
{
|
{
|
||||||
for (r = in; *r != 0 && *r != ':' && *r != '-'; r++)
|
for (r = in; *r != 0 && *r != ':' && *r != '-' && *r != ' '; r++)
|
||||||
if (*r != '*' && !isxdigit((unsigned char)*r))
|
if (*r != '*' && !isxdigit((unsigned char)*r))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -444,12 +444,29 @@ int parse_hex(char *in, unsigned char *out, int maxlen,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
*r = 0;
|
*r = 0;
|
||||||
mask = mask << 1;
|
|
||||||
if (strcmp(in, "*") == 0)
|
if (strcmp(in, "*") == 0)
|
||||||
mask |= 1;
|
{
|
||||||
|
mask = (mask << 1) | 1;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
out[i] = strtol(in, NULL, 16);
|
{
|
||||||
i++;
|
int j, bytes = (1 + (r - in))/2;
|
||||||
|
for (j = 0; j < bytes; j++)
|
||||||
|
{
|
||||||
|
char sav;
|
||||||
|
if (j < bytes - 1)
|
||||||
|
{
|
||||||
|
sav = in[(j+1)*2];
|
||||||
|
in[(j+1)*2] = 0;
|
||||||
|
}
|
||||||
|
out[i] = strtol(&in[j*2], NULL, 16);
|
||||||
|
mask = mask << 1;
|
||||||
|
i++;
|
||||||
|
if (j < bytes - 1)
|
||||||
|
in[(j+1)*2] = sav;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
in = r+1;
|
in = r+1;
|
||||||
|
|||||||
Reference in new issue
Block a user