mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-07 16:01:41 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae290659de | ||
|
|
6b2b564ac3 | ||
|
|
4f7bb57e97 | ||
|
|
56f0623930 | ||
|
|
f3223fbff6 | ||
|
|
4c4f4c2649 | ||
|
|
773af304ea | ||
|
|
4cc944b0d6 | ||
|
|
87e00feb01 | ||
|
|
e7a4af8903 | ||
|
|
2d69d6146d | ||
|
|
30e4a9441e | ||
|
|
232a8f3569 |
No files matched your search
+2
-3
@@ -7,9 +7,8 @@ src/.copts_*
|
|||||||
contrib/lease-tools/dhcp_lease_time
|
contrib/lease-tools/dhcp_lease_time
|
||||||
contrib/lease-tools/dhcp_release
|
contrib/lease-tools/dhcp_release
|
||||||
contrib/lease-tools/dhcp_release6
|
contrib/lease-tools/dhcp_release6
|
||||||
debian/base/
|
|
||||||
debian/daemon/
|
|
||||||
debian/files
|
debian/files
|
||||||
debian/substvars
|
debian/substvars
|
||||||
debian/utils-substvars
|
debian/utils-substvars
|
||||||
debian/utils/
|
debian/trees/
|
||||||
|
debian/build/
|
||||||
@@ -46,6 +46,20 @@ version 2.79
|
|||||||
http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf
|
http://cs.northwestern.edu/~ychen/Papers/DNS_ToN15.pdf
|
||||||
Thanks to Mattias Hellström for the initial patch.
|
Thanks to Mattias Hellström for the initial patch.
|
||||||
|
|
||||||
|
Fix failure to delete dynamically created dhcp options
|
||||||
|
from files in -dhcp-optsdir directories. Thanks to
|
||||||
|
Lindgren Fredrik for the bug report.
|
||||||
|
|
||||||
|
Add to --synth-domain the ability to create names using
|
||||||
|
sequential numbers, as well as encodings of IP addresses.
|
||||||
|
For instance,
|
||||||
|
--synth-domain=thekelleys.org.uk,192.168.0.50,192.168.0.70,internal-*
|
||||||
|
creates 21 domain names of the form
|
||||||
|
internal-4.thekelleys.org.uk over the address range given, with
|
||||||
|
internal-0.thekelleys.org.uk being 192.168.0.50 and
|
||||||
|
internal-20.thekelleys.org.uk being 192.168.0.70
|
||||||
|
Thanks to Andy Hawkins for the suggestion.
|
||||||
|
|
||||||
|
|
||||||
version 2.78
|
version 2.78
|
||||||
Fix logic of appending ".<layer>" to PXE basename. Thanks to Chris
|
Fix logic of appending ".<layer>" to PXE basename. Thanks to Chris
|
||||||
|
|||||||
Vendored
+5
-1
@@ -4,8 +4,12 @@ dnsmasq (2.79-1) unstable; urgency=low
|
|||||||
* Fix trust-anchor regex in init script. (closes: #884347)
|
* Fix trust-anchor regex in init script. (closes: #884347)
|
||||||
* Fix exit code for dhcp_release6 (closes: #833596)
|
* Fix exit code for dhcp_release6 (closes: #833596)
|
||||||
* Add project homepage to control file. (closes: #887764)
|
* Add project homepage to control file. (closes: #887764)
|
||||||
|
* New binary package dnsmasq-base-lua, includes Lua support.
|
||||||
|
* Remove hardwired shlibs dependency for libnettle 3.3 and
|
||||||
|
fix code to avoid ABI breakage as long as compiled against
|
||||||
|
libnettle 3.4 or later. (closes: #891315)
|
||||||
|
|
||||||
-- Simon Kelley <simon@thekelleys.org.uk> Thu, 8 Feb 2018 21:27:22 +0000
|
-- Simon Kelley <simon@thekelleys.org.uk> Fri, 16 Feb 2018 19:54:22 +0000
|
||||||
|
|
||||||
dnsmasq (2.78-3) unstable; urgency=high
|
dnsmasq (2.78-3) unstable; urgency=high
|
||||||
|
|
||||||
|
|||||||
Vendored
+20
-3
@@ -3,14 +3,15 @@ Section: net
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Build-depends: gettext, libnetfilter-conntrack-dev [linux-any],
|
Build-depends: gettext, libnetfilter-conntrack-dev [linux-any],
|
||||||
libidn11-dev, libdbus-1-dev (>=0.61), libgmp-dev,
|
libidn11-dev, libdbus-1-dev (>=0.61), libgmp-dev,
|
||||||
nettle-dev (>=2.4-3), libbsd-dev [!linux-any]
|
nettle-dev (>=2.4-3), libbsd-dev [!linux-any],
|
||||||
|
liblua5.2-dev
|
||||||
Maintainer: Simon Kelley <simon@thekelleys.org.uk>
|
Maintainer: Simon Kelley <simon@thekelleys.org.uk>
|
||||||
Homepage: http://www.thekelleys.org.uk/dnsmasq/doc.html
|
Homepage: http://www.thekelleys.org.uk/dnsmasq/doc.html
|
||||||
Standards-Version: 3.9.8
|
Standards-Version: 3.9.8
|
||||||
|
|
||||||
Package: dnsmasq
|
Package: dnsmasq
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: netbase, dnsmasq-base(>= ${binary:Version}),
|
Depends: netbase, dnsmasq-base,
|
||||||
init-system-helpers (>= 1.18~), lsb-base (>= 3.0-6)
|
init-system-helpers (>= 1.18~), lsb-base (>= 3.0-6)
|
||||||
Suggests: resolvconf
|
Suggests: resolvconf
|
||||||
Conflicts: resolvconf (<<1.15)
|
Conflicts: resolvconf (<<1.15)
|
||||||
@@ -28,13 +29,29 @@ Package: dnsmasq-base
|
|||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: adduser, ${shlibs:Depends}
|
Depends: adduser, ${shlibs:Depends}
|
||||||
Breaks: dnsmasq (<< 2.63-1~)
|
Breaks: dnsmasq (<< 2.63-1~)
|
||||||
Replaces: dnsmasq (<< 2.63-1~)
|
Replaces: dnsmasq (<< 2.63-1~), dnsmasq-base
|
||||||
Recommends: dns-root-data
|
Recommends: dns-root-data
|
||||||
|
Provides: dnsmasq-base
|
||||||
|
Conflicts: dnsmasq-base-lua
|
||||||
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
|
||||||
that, install the dnsmasq package.
|
that, install the dnsmasq package.
|
||||||
|
|
||||||
|
Package: dnsmasq-base-lua
|
||||||
|
Architecture: any
|
||||||
|
Depends: adduser, ${shlibs:Depends}
|
||||||
|
Breaks: dnsmasq (<< 2.63-1~)
|
||||||
|
Replaces: dnsmasq (<< 2.63-1~), dnsmasq-base
|
||||||
|
Recommends: dns-root-data
|
||||||
|
Provides: dnsmasq-base
|
||||||
|
Conflicts: dnsmasq-base
|
||||||
|
Description: Small caching DNS proxy and DHCP/TFTP server
|
||||||
|
This package contains the dnsmasq executable and documentation, but
|
||||||
|
not the infrastructure required to run it as a system daemon. For
|
||||||
|
that, install the dnsmasq package. This package is an alternative
|
||||||
|
to dnsmasq-base which includes the LUA interpreter.
|
||||||
|
|
||||||
Package: dnsmasq-utils
|
Package: dnsmasq-utils
|
||||||
Architecture: linux-any
|
Architecture: linux-any
|
||||||
Depends: ${shlibs:Depends}
|
Depends: ${shlibs:Depends}
|
||||||
|
|||||||
Vendored
+151
-112
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
# debian/rules file - for dnsmasq.
|
# debian/rules file - for dnsmasq.
|
||||||
# Copyright 2001-2011 by Simon Kelley
|
# Copyright 2001-2018 by Simon Kelley
|
||||||
# Based on the sample in the debian hello package which carries the following:
|
# Based on the sample in the debian hello package which carries the following:
|
||||||
# Copyright 1994,1995 by Ian Jackson.
|
# Copyright 1994,1995 by Ian Jackson.
|
||||||
# I hereby give you perpetual unlimited permission to copy,
|
# I hereby give you perpetual unlimited permission to copy,
|
||||||
@@ -103,128 +103,167 @@ ifneq ($(DEB_HOST_ARCH_OS),linux)
|
|||||||
LDFLAGS += -lbsd
|
LDFLAGS += -lbsd
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
define build_tree
|
||||||
$(checkdir)
|
rm -rf $1
|
||||||
rm -rf debian/daemon debian/base debian/utils debian/*~ debian/files debian/substvars debian/utils-substvars
|
|
||||||
make clean
|
|
||||||
make -C contrib/lease-tools clean
|
|
||||||
|
|
||||||
binary-indep: checkroot
|
|
||||||
$(checkdir)
|
|
||||||
rm -rf debian/daemon
|
|
||||||
install -m 755 \
|
install -m 755 \
|
||||||
-d debian/daemon/DEBIAN \
|
-d $1/DEBIAN \
|
||||||
-d debian/daemon/usr/share/doc \
|
-d $1/etc/dbus-1/system.d \
|
||||||
-d debian/daemon/etc/init.d \
|
-d $1/usr/share/doc/$(package) \
|
||||||
-d debian/daemon/etc/dnsmasq.d \
|
-d $1/usr/share/doc/$(package)/examples \
|
||||||
-d debian/daemon/etc/resolvconf/update.d \
|
-d $1/usr/share/$(package) \
|
||||||
-d debian/daemon/usr/lib/resolvconf/dpkg-event.d \
|
-d $1/var/lib/misc
|
||||||
-d debian/daemon/usr/share/dnsmasq \
|
|
||||||
-d debian/daemon/etc/default \
|
|
||||||
-d debian/daemon/lib/systemd/system \
|
|
||||||
-d debian/daemon/etc/insserv.conf.d
|
|
||||||
install -m 644 debian/conffiles debian/daemon/DEBIAN
|
|
||||||
install -m 755 debian/postinst debian/postrm debian/prerm debian/daemon/DEBIAN
|
|
||||||
install -m 755 debian/init debian/daemon/etc/init.d/dnsmasq
|
|
||||||
install -m 755 debian/resolvconf debian/daemon/etc/resolvconf/update.d/dnsmasq
|
|
||||||
install -m 755 debian/resolvconf-package debian/daemon/usr/lib/resolvconf/dpkg-event.d/dnsmasq
|
|
||||||
install -m 644 debian/installed-marker debian/daemon/usr/share/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 debian/readme.dnsmasq.d debian/daemon/etc/dnsmasq.d/README
|
|
||||||
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
|
|
||||||
ln -s $(package) debian/daemon/usr/share/doc/dnsmasq
|
|
||||||
cd debian/daemon && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
|
|
||||||
dpkg-gencontrol $(PACKAGE_VERSION) -T -pdnsmasq -Pdebian/daemon
|
|
||||||
find debian/daemon -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
|
|
||||||
chown -R root.root debian/daemon
|
|
||||||
chmod -R g-ws debian/daemon
|
|
||||||
dpkg --build debian/daemon ..
|
|
||||||
|
|
||||||
binary-arch: checkroot
|
endef
|
||||||
$(checkdir)
|
|
||||||
rm -rf debian/base
|
define add_docs
|
||||||
install -m 755 \
|
|
||||||
-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)/examples \
|
|
||||||
-d debian/base/usr/share/$(package) \
|
|
||||||
-d debian/base/var/lib/misc
|
|
||||||
make $(TARGET) PREFIX=/usr DESTDIR=`pwd`/debian/base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG)
|
|
||||||
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
|
||||||
# Need to remove paypal links in Debian Package for policy reasons.
|
# Need to remove paypal links in Debian Package for policy reasons.
|
||||||
sed -e /\<H2\>Donations/Q -e /icon.png/d doc.html -e /favicon.ico/d >debian/base/usr/share/doc/$(package)/doc.html
|
sed -e /\<H2\>Donations/Q -e /icon.png/d doc.html -e /favicon.ico/d >$1/usr/share/doc/$(package)/doc.html
|
||||||
echo "</BODY>" >>debian/base/usr/share/doc/$(package)/doc.html
|
echo "</BODY>" >>$1/usr/share/doc/$(package)/doc.html
|
||||||
install -m 644 setup.html debian/base/usr/share/doc/$(package)/.
|
install -m 644 setup.html $1/usr/share/doc/$(package)/.
|
||||||
install -m 644 dnsmasq.conf.example debian/base/usr/share/doc/$(package)/examples/.
|
install -m 644 dnsmasq.conf.example $1/usr/share/doc/$(package)/examples/.
|
||||||
install -m 644 trust-anchors.conf debian/base/usr/share/$(package)/.
|
install -m 644 FAQ $1/usr/share/doc/$(package)/.
|
||||||
install -m 644 FAQ debian/base/usr/share/doc/$(package)/.
|
gzip -9n $1/usr/share/doc/$(package)/FAQ
|
||||||
gzip -9n debian/base/usr/share/doc/$(package)/FAQ
|
install -m 644 CHANGELOG $1/usr/share/doc/$(package)/changelog
|
||||||
install -m 644 CHANGELOG debian/base/usr/share/doc/$(package)/changelog
|
gzip -9n $1/usr/share/doc/$(package)/changelog
|
||||||
gzip -9n debian/base/usr/share/doc/$(package)/changelog
|
install -m 644 CHANGELOG.archive $1/usr/share/doc/$(package)/changelog.archive
|
||||||
install -m 644 CHANGELOG.archive debian/base/usr/share/doc/$(package)/changelog.archive
|
gzip -9n $1/usr/share/doc/$(package)/changelog.archive
|
||||||
gzip -9n debian/base/usr/share/doc/$(package)/changelog.archive
|
install -m 644 dbus/DBus-interface $1/usr/share/doc/$(package)/.
|
||||||
install -m 644 dbus/DBus-interface debian/base/usr/share/doc/$(package)/.
|
gzip -9n $1/usr/share/doc/$(package)/DBus-interface
|
||||||
gzip -9n debian/base/usr/share/doc/$(package)/DBus-interface
|
gzip -9n $1/usr/share/man/man8/dnsmasq.8
|
||||||
endif
|
for f in $1/usr/share/man/*; do \
|
||||||
install -m 644 debian/dnsmasq-base.conffiles debian/base/DEBIAN/conffiles
|
|
||||||
install -m 755 debian/dnsmasq-base.postinst debian/base/DEBIAN/postinst
|
|
||||||
install -m 755 debian/dnsmasq-base.postrm debian/base/DEBIAN/postrm
|
|
||||||
install -m 644 debian/changelog debian/base/usr/share/doc/$(package)/changelog.Debian
|
|
||||||
gzip -9n 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/copyright debian/base/usr/share/doc/$(package)/copyright
|
|
||||||
install -m 644 debian/dbus.conf debian/base/etc/dbus-1/system.d/dnsmasq.conf
|
|
||||||
gzip -9n debian/base/usr/share/man/man8/dnsmasq.8
|
|
||||||
for f in debian/base/usr/share/man/*; do \
|
|
||||||
if [ -f $$f/man8/dnsmasq.8 ]; then \
|
if [ -f $$f/man8/dnsmasq.8 ]; then \
|
||||||
gzip -9n $$f/man8/dnsmasq.8 ; \
|
gzip -9n $$f/man8/dnsmasq.8 ; \
|
||||||
fi \
|
fi \
|
||||||
done
|
done
|
||||||
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
endef
|
||||||
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/base/usr/sbin/dnsmasq
|
|
||||||
|
define add_files
|
||||||
|
install -m 644 trust-anchors.conf $1/usr/share/$(package)/.
|
||||||
|
install -m 644 debian/dnsmasq-base.conffiles $1/DEBIAN/conffiles
|
||||||
|
install -m 755 debian/dnsmasq-base.postinst $1/DEBIAN/postinst
|
||||||
|
install -m 755 debian/dnsmasq-base.postrm $1/DEBIAN/postrm
|
||||||
|
install -m 644 debian/changelog $1/usr/share/doc/$(package)/changelog.Debian
|
||||||
|
gzip -9n $1/usr/share/doc/$(package)/changelog.Debian
|
||||||
|
install -m 644 debian/readme $1/usr/share/doc/$(package)/README.Debian
|
||||||
|
install -m 644 debian/copyright $1/usr/share/doc/$(package)/copyright
|
||||||
|
install -m 644 debian/dbus.conf $1/etc/dbus-1/system.d/dnsmasq.conf
|
||||||
|
endef
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(checkdir)
|
||||||
|
make BUILDDIR=debian/build/no-lua clean
|
||||||
|
make BUILDDIR=debian/build/lua clean
|
||||||
|
make -C contrib/lease-tools clean
|
||||||
|
rm -rf debian/build debian/trees debian/*~ debian/files debian/substvars debian/utils-substvars
|
||||||
|
|
||||||
|
binary-indep: checkroot
|
||||||
|
$(checkdir)
|
||||||
|
rm -rf debian/trees/daemon
|
||||||
|
install -m 755 \
|
||||||
|
-d debian/trees/daemon/DEBIAN \
|
||||||
|
-d debian/trees/daemon/usr/share/doc \
|
||||||
|
-d debian/trees/daemon/etc/init.d \
|
||||||
|
-d debian/trees/daemon/etc/dnsmasq.d \
|
||||||
|
-d debian/trees/daemon/etc/resolvconf/update.d \
|
||||||
|
-d debian/trees/daemon/usr/lib/resolvconf/dpkg-event.d \
|
||||||
|
-d debian/trees/daemon/usr/share/dnsmasq \
|
||||||
|
-d debian/trees/daemon/etc/default \
|
||||||
|
-d debian/trees/daemon/lib/systemd/system \
|
||||||
|
-d debian/trees/daemon/etc/insserv.conf.d
|
||||||
|
install -m 644 debian/conffiles debian/trees/daemon/DEBIAN
|
||||||
|
install -m 755 debian/postinst debian/postrm debian/prerm debian/trees/daemon/DEBIAN
|
||||||
|
install -m 755 debian/init debian/trees/daemon/etc/init.d/dnsmasq
|
||||||
|
install -m 755 debian/resolvconf debian/trees/daemon/etc/resolvconf/update.d/dnsmasq
|
||||||
|
install -m 755 debian/resolvconf-package debian/trees/daemon/usr/lib/resolvconf/dpkg-event.d/dnsmasq
|
||||||
|
install -m 644 debian/installed-marker debian/trees/daemon/usr/share/dnsmasq
|
||||||
|
install -m 644 debian/default debian/trees/daemon/etc/default/dnsmasq
|
||||||
|
install -m 644 dnsmasq.conf.example debian/trees/daemon/etc/dnsmasq.conf
|
||||||
|
install -m 644 debian/readme.dnsmasq.d debian/trees/daemon/etc/dnsmasq.d/README
|
||||||
|
install -m 644 debian/systemd.service debian/trees/daemon/lib/systemd/system/dnsmasq.service
|
||||||
|
install -m 644 debian/insserv debian/trees/daemon/etc/insserv.conf.d/dnsmasq
|
||||||
|
ln -s $(package) debian/trees/daemon/usr/share/doc/dnsmasq
|
||||||
|
cd debian/trees/daemon && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
|
||||||
|
dpkg-gencontrol $(PACKAGE_VERSION) -T -pdnsmasq -Pdebian/trees/daemon
|
||||||
|
find debian/trees/daemon -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
|
||||||
|
chown -R root.root debian/trees/daemon
|
||||||
|
chmod -R g-ws debian/trees/daemon
|
||||||
|
dpkg --build debian/trees/daemon ..
|
||||||
|
|
||||||
|
binary-arch: checkroot
|
||||||
|
$(call build_tree,debian/trees/base)
|
||||||
|
make $(TARGET) BUILDDIR=debian/build/no-lua PREFIX=/usr DESTDIR=`pwd`/debian/trees/base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG)
|
||||||
|
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
||||||
|
$(call add_docs,debian/trees/base)
|
||||||
|
else
|
||||||
|
rm -rf debian/trees/base/usr/share/man
|
||||||
endif
|
endif
|
||||||
cd debian/base && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
|
$(call add_files,debian/trees/base)
|
||||||
dpkg-shlibdeps --warnings=1 debian/base/usr/sbin/dnsmasq
|
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
||||||
dpkg-gencontrol $(PACKAGE_VERSION) -pdnsmasq-base -Pdebian/base
|
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/base/usr/sbin/dnsmasq
|
||||||
find debian/base -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
|
endif
|
||||||
chown -R root.root debian/base
|
cd debian/trees/base && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
|
||||||
chmod -R g-ws debian/base
|
dpkg-shlibdeps --warnings=1 debian/trees/base/usr/sbin/dnsmasq
|
||||||
dpkg --build debian/base ..
|
dpkg-gencontrol $(PACKAGE_VERSION) -pdnsmasq-base -Pdebian/trees/base
|
||||||
|
find debian/trees/base -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
|
||||||
|
chown -R root.root debian/trees/base
|
||||||
|
chmod -R g-ws debian/trees/base
|
||||||
|
dpkg --build debian/trees/base ..
|
||||||
|
|
||||||
|
$(call build_tree,debian/trees/lua-base)
|
||||||
|
make $(TARGET) BUILDDIR=debian/build/lua PREFIX=/usr DESTDIR=`pwd`/debian/trees/lua-base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="-DHAVE_LUASCRIPT $(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG)
|
||||||
|
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
||||||
|
$(call add_docs,debian/trees/lua-base)
|
||||||
|
else
|
||||||
|
rm -rf debian/trees/lua-base/usr/share/man
|
||||||
|
endif
|
||||||
|
$(call add_files,debian/trees/lua-base)
|
||||||
|
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
||||||
|
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/lua-base/usr/sbin/dnsmasq
|
||||||
|
endif
|
||||||
|
cd debian/trees/lua-base && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
|
||||||
|
dpkg-shlibdeps --warnings=1 debian/trees/lua-base/usr/sbin/dnsmasq
|
||||||
|
dpkg-gencontrol $(PACKAGE_VERSION) -pdnsmasq-base-lua -Pdebian/trees/lua-base
|
||||||
|
find debian/trees/lua-base -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
|
||||||
|
chown -R root.root debian/trees/lua-base
|
||||||
|
chmod -R g-ws debian/trees/lua-base
|
||||||
|
dpkg --build debian/trees/lua-base ..
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(DEB_HOST_ARCH_OS),linux)
|
ifeq ($(DEB_HOST_ARCH_OS),linux)
|
||||||
rm -rf debian/utils
|
rm -rf debian/trees/utils
|
||||||
install -m 755 -d debian/utils/DEBIAN \
|
install -m 755 -d debian/trees/utils/DEBIAN \
|
||||||
-d debian/utils/usr/share/man/man1 \
|
-d debian/trees/utils/usr/bin \
|
||||||
-d debian/utils/usr/bin \
|
-d debian/trees/utils/usr/share/doc/dnsmasq-utils
|
||||||
-d debian/utils/usr/share/doc/dnsmasq-utils
|
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
||||||
make -C contrib/lease-tools PREFIX=/usr DESTDIR=`pwd`/debian/utils CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG)
|
install -m 755 -d debian/trees/utils/usr/share/man/man1
|
||||||
install -m 755 contrib/lease-tools/dhcp_release debian/utils/usr/bin/dhcp_release
|
|
||||||
install -m 644 contrib/lease-tools/dhcp_release.1 debian/utils/usr/share/man/man1/dhcp_release.1
|
|
||||||
gzip -9n debian/utils/usr/share/man/man1/dhcp_release.1
|
|
||||||
install -m 755 contrib/lease-tools/dhcp_release6 debian/utils/usr/bin/dhcp_release6
|
|
||||||
install -m 644 contrib/lease-tools/dhcp_release6.1 debian/utils/usr/share/man/man1/dhcp_release6.1
|
|
||||||
gzip -9n debian/utils/usr/share/man/man1/dhcp_release6.1
|
|
||||||
install -m 755 contrib/lease-tools/dhcp_lease_time debian/utils/usr/bin/dhcp_lease_time
|
|
||||||
install -m 644 contrib/lease-tools/dhcp_lease_time.1 debian/utils/usr/share/man/man1/dhcp_lease_time.1
|
|
||||||
install -m 644 debian/copyright debian/utils/usr/share/doc/dnsmasq-utils/copyright
|
|
||||||
install -m 644 debian/changelog debian/utils/usr/share/doc/dnsmasq-utils/changelog.Debian
|
|
||||||
gzip -9n debian/utils/usr/share/doc/dnsmasq-utils/changelog.Debian
|
|
||||||
gzip -9n debian/utils/usr/share/man/man1/dhcp_lease_time.1
|
|
||||||
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
|
||||||
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/utils/usr/bin/dhcp_release
|
|
||||||
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/utils/usr/bin/dhcp_release6
|
|
||||||
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/utils/usr/bin/dhcp_lease_time
|
|
||||||
endif
|
endif
|
||||||
cd debian/utils && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
|
make -C contrib/lease-tools PREFIX=/usr DESTDIR=`pwd`/debian/trees/utils CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG)
|
||||||
dpkg-shlibdeps -Tdebian/utils-substvars debian/utils/usr/bin/dhcp_release debian/utils/usr/bin/dhcp_lease_time
|
install -m 755 contrib/lease-tools/dhcp_release debian/trees/utils/usr/bin/dhcp_release
|
||||||
dpkg-gencontrol $(PACKAGE_VERSION) -Tdebian/utils-substvars -pdnsmasq-utils -Pdebian/utils
|
install -m 755 contrib/lease-tools/dhcp_release6 debian/trees/utils/usr/bin/dhcp_release6
|
||||||
find debian/utils -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
|
install -m 755 contrib/lease-tools/dhcp_lease_time debian/trees/utils/usr/bin/dhcp_lease_time
|
||||||
chown -R root.root debian/utils
|
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
||||||
chmod -R g-ws debian/utils
|
install -m 644 contrib/lease-tools/dhcp_release.1 debian/trees/utils/usr/share/man/man1/dhcp_release.1
|
||||||
dpkg --build debian/utils ..
|
gzip -9n debian/trees/utils/usr/share/man/man1/dhcp_release.1
|
||||||
|
install -m 644 contrib/lease-tools/dhcp_release6.1 debian/trees/utils/usr/share/man/man1/dhcp_release6.1
|
||||||
|
gzip -9n debian/trees/utils/usr/share/man/man1/dhcp_release6.1
|
||||||
|
install -m 644 contrib/lease-tools/dhcp_lease_time.1 debian/trees/utils/usr/share/man/man1/dhcp_lease_time.1
|
||||||
|
gzip -9n debian/trees/utils/usr/share/man/man1/dhcp_lease_time.1
|
||||||
|
endif
|
||||||
|
install -m 644 debian/copyright debian/trees/utils/usr/share/doc/dnsmasq-utils/copyright
|
||||||
|
install -m 644 debian/changelog debian/trees/utils/usr/share/doc/dnsmasq-utils/changelog.Debian
|
||||||
|
gzip -9n debian/trees/utils/usr/share/doc/dnsmasq-utils/changelog.Debian
|
||||||
|
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
||||||
|
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/utils/usr/bin/dhcp_release
|
||||||
|
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/utils/usr/bin/dhcp_release6
|
||||||
|
$(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/utils/usr/bin/dhcp_lease_time
|
||||||
|
endif
|
||||||
|
cd debian/trees/utils && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
|
||||||
|
dpkg-shlibdeps -Tdebian/utils-substvars debian/trees/utils/usr/bin/dhcp_release debian/trees/utils/usr/bin/dhcp_release6 debian/trees/utils/usr/bin/dhcp_lease_time
|
||||||
|
dpkg-gencontrol $(PACKAGE_VERSION) -Tdebian/utils-substvars -pdnsmasq-utils -Pdebian/trees/utils
|
||||||
|
find debian/trees/utils -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
|
||||||
|
chown -R root.root debian/trees/utils
|
||||||
|
chmod -R g-ws debian/trees/utils
|
||||||
|
dpkg --build debian/trees/utils ..
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define checkdir
|
define checkdir
|
||||||
|
|||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
libnettle 6 libnettle6 (>= 3.3)
|
|
||||||
+10
-7
@@ -626,13 +626,16 @@ address by repeating the flag; in that case the first instance is used
|
|||||||
for the reverse address-to-name mapping. Note that a name used in
|
for the reverse address-to-name mapping. Note that a name used in
|
||||||
--interface-name may not appear in /etc/hosts.
|
--interface-name may not appear in /etc/hosts.
|
||||||
.TP
|
.TP
|
||||||
.B --synth-domain=<domain>,<address range>[,<prefix>]
|
.B --synth-domain=<domain>,<address range>[,<prefix>[*]]
|
||||||
Create artificial A/AAAA and PTR records for an address range. The
|
Create artificial A/AAAA and PTR records for an address range. The
|
||||||
records use the address, with periods (or colons for IPv6) replaced
|
records either seqential numbers or the address, with periods (or colons for IPv6) replaced with dashes.
|
||||||
with dashes.
|
|
||||||
|
|
||||||
An example should make this clearer.
|
An examples should make this clearer. First sequential numbers.
|
||||||
.B --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal-
|
.B --synth-domain=thekelleys.org.uk,192.168.0.50,192.168.0.70,internal-*
|
||||||
|
results in the name internal-0.thekelleys.org.uk. returning 192.168.0.50, internal-1.thekelleys.org.uk returning 192.168.0.51 and so on. (note the *) The same principle applies to IPv6 addresses (where the numbers may be very large). Reverse lookups from address to name behave as expected.
|
||||||
|
|
||||||
|
Second,
|
||||||
|
.B --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal- (no *)
|
||||||
will result in a query for internal-192-168-0-56.thekelleys.org.uk returning
|
will result in a query for internal-192-168-0-56.thekelleys.org.uk returning
|
||||||
192.168.0.56 and a reverse query vice versa. The same applies to IPv6,
|
192.168.0.56 and a reverse query vice versa. The same applies to IPv6,
|
||||||
but IPv6 addresses may start with '::'
|
but IPv6 addresses may start with '::'
|
||||||
@@ -642,7 +645,7 @@ configured a zero is added in front of the label. ::1 becomes 0--1.
|
|||||||
V4 mapped IPv6 addresses, which have a representation like ::ffff:1.2.3.4 are handled specially, and become like 0--ffff-1-2-3-4
|
V4 mapped IPv6 addresses, which have a representation like ::ffff:1.2.3.4 are handled specially, and become like 0--ffff-1-2-3-4
|
||||||
|
|
||||||
The address range can be of the form
|
The address range can be of the form
|
||||||
<ip address>,<ip address> or <ip address>/<netmask>
|
<ip address>,<ip address> or <ip address>/<netmask> in both forms of the option.
|
||||||
.TP
|
.TP
|
||||||
.B --add-mac[=base64|text]
|
.B --add-mac[=base64|text]
|
||||||
Add the MAC address of the requestor to DNS queries which are
|
Add the MAC address of the requestor to DNS queries which are
|
||||||
@@ -1078,7 +1081,7 @@ in a dhcp-optsfile.
|
|||||||
This is equivalent to dhcp-hostsfile, except for the following. The path MUST be a
|
This is equivalent to dhcp-hostsfile, except for the following. The path MUST be a
|
||||||
directory, and not an individual file. Changed or new files within
|
directory, and not an individual file. Changed or new files within
|
||||||
the directory are read automatically, without the need to send SIGHUP.
|
the directory are read automatically, without the need to send SIGHUP.
|
||||||
If a file is deleted for changed after it has been read by dnsmasq, then the
|
If a file is deleted or changed after it has been read by dnsmasq, then the
|
||||||
host record it contained will remain until dnsmasq receives a SIGHUP, or
|
host record it contained will remain until dnsmasq receives a SIGHUP, or
|
||||||
is restarted; ie host records are only added dynamically.
|
is restarted; ie host records are only added dynamically.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
+196
-191
File diff suppressed because it is too large.
Load diff
+13
-5
@@ -114,17 +114,25 @@ const struct nettle_hash *hash_find(char *name)
|
|||||||
if (!name)
|
if (!name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
/* We provide a "null" hash which returns the input data as digest. */
|
||||||
|
if (strcmp(null_hash.name, name) == 0)
|
||||||
|
return &null_hash;
|
||||||
|
|
||||||
|
/* libnettle >= 3.4 provides nettle_lookup_hash() which avoids nasty ABI
|
||||||
|
incompatibilities if sizeof(nettle_hashes) changes between library
|
||||||
|
versions. */
|
||||||
|
|
||||||
|
#if (NETTLE_VERSION_MAJOR>3) || ((NETTLE_VERSION_MAJOR==3) && (NETTLE_VERSION_MINOR >=4))
|
||||||
|
return nettle_lookup_hash(name);
|
||||||
|
#else
|
||||||
for (i = 0; nettle_hashes[i]; i++)
|
for (i = 0; nettle_hashes[i]; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(nettle_hashes[i]->name, name) == 0)
|
if (strcmp(nettle_hashes[i]->name, name) == 0)
|
||||||
return nettle_hashes[i];
|
return nettle_hashes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We provide a "null" hash which returns the input data as digest. */
|
return NULL;
|
||||||
if (strcmp(null_hash.name, name) == 0)
|
#endif
|
||||||
return &null_hash;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* expand ctx and digest memory allocations if necessary and init hash function */
|
/* expand ctx and digest memory allocations if necessary and init hash function */
|
||||||
|
|||||||
+9
-3
@@ -1214,30 +1214,39 @@ static void fatal_event(struct event_desc *ev, char *msg)
|
|||||||
case EVENT_FORK_ERR:
|
case EVENT_FORK_ERR:
|
||||||
die(_("cannot fork into background: %s"), NULL, EC_MISC);
|
die(_("cannot fork into background: %s"), NULL, EC_MISC);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_PIPE_ERR:
|
case EVENT_PIPE_ERR:
|
||||||
die(_("failed to create helper: %s"), NULL, EC_MISC);
|
die(_("failed to create helper: %s"), NULL, EC_MISC);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_CAP_ERR:
|
case EVENT_CAP_ERR:
|
||||||
die(_("setting capabilities failed: %s"), NULL, EC_MISC);
|
die(_("setting capabilities failed: %s"), NULL, EC_MISC);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_USER_ERR:
|
case EVENT_USER_ERR:
|
||||||
die(_("failed to change user-id to %s: %s"), msg, EC_MISC);
|
die(_("failed to change user-id to %s: %s"), msg, EC_MISC);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_GROUP_ERR:
|
case EVENT_GROUP_ERR:
|
||||||
die(_("failed to change group-id to %s: %s"), msg, EC_MISC);
|
die(_("failed to change group-id to %s: %s"), msg, EC_MISC);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_PIDFILE:
|
case EVENT_PIDFILE:
|
||||||
die(_("failed to open pidfile %s: %s"), msg, EC_FILE);
|
die(_("failed to open pidfile %s: %s"), msg, EC_FILE);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_LOG_ERR:
|
case EVENT_LOG_ERR:
|
||||||
die(_("cannot open log %s: %s"), msg, EC_FILE);
|
die(_("cannot open log %s: %s"), msg, EC_FILE);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
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);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_TFTP_ERR:
|
case EVENT_TFTP_ERR:
|
||||||
die(_("TFTP directory %s inaccessible: %s"), msg, EC_FILE);
|
die(_("TFTP directory %s inaccessible: %s"), msg, EC_FILE);
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
case EVENT_TIME_ERR:
|
case EVENT_TIME_ERR:
|
||||||
die(_("cannot create timestamp file %s: %s" ), msg, EC_BADCONF);
|
die(_("cannot create timestamp file %s: %s" ), msg, EC_BADCONF);
|
||||||
}
|
}
|
||||||
@@ -1502,9 +1511,6 @@ void clear_cache_and_reload(time_t now)
|
|||||||
if (option_bool(OPT_ETHERS))
|
if (option_bool(OPT_ETHERS))
|
||||||
dhcp_read_ethers();
|
dhcp_read_ethers();
|
||||||
reread_dhcp();
|
reread_dhcp();
|
||||||
#ifdef HAVE_INOTIFY
|
|
||||||
set_dynamic_inotify(AH_DHCP_HST | AH_DHCP_OPT, 0, NULL, 0);
|
|
||||||
#endif
|
|
||||||
dhcp_update_configs(daemon->dhcp_conf);
|
dhcp_update_configs(daemon->dhcp_conf);
|
||||||
lease_update_from_configs();
|
lease_update_from_configs();
|
||||||
lease_update_file(now);
|
lease_update_file(now);
|
||||||
|
|||||||
+1
-1
@@ -839,7 +839,7 @@ struct cond_domain {
|
|||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
struct in6_addr start6, end6;
|
struct in6_addr start6, end6;
|
||||||
#endif
|
#endif
|
||||||
int is6;
|
int is6, indexed;
|
||||||
struct cond_domain *next;
|
struct cond_domain *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+140
-73
@@ -56,73 +56,122 @@ int is_name_synthetic(int flags, char *name, struct all_addr *addr)
|
|||||||
if (pref && *pref != 0)
|
if (pref && *pref != 0)
|
||||||
continue; /* prefix match fail */
|
continue; /* prefix match fail */
|
||||||
|
|
||||||
/* NB, must not alter name if we return zero */
|
if (c->indexed)
|
||||||
for (p = tail; *p; p++)
|
|
||||||
{
|
{
|
||||||
char c = *p;
|
for (p = tail; *p; p++)
|
||||||
|
{
|
||||||
|
char c = *p;
|
||||||
|
|
||||||
if ((c >='0' && c <= '9') || c == '-')
|
if (c < '0' || c > '9')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*p != '.')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
*p = 0;
|
||||||
|
|
||||||
|
if (hostname_isequal(c->domain, p+1))
|
||||||
|
{
|
||||||
|
if (prot == AF_INET)
|
||||||
|
{
|
||||||
|
unsigned int index = atoi(tail);
|
||||||
|
|
||||||
|
if (!c->is6 &&
|
||||||
|
index <= ntohl(c->end.s_addr) - ntohl(c->start.s_addr))
|
||||||
|
{
|
||||||
|
addr->addr.addr4.s_addr = htonl(ntohl(c->start.s_addr) + index);
|
||||||
|
found = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if (prot == AF_INET6 && ((c >='A' && c <= 'F') || (c >='a' && c <= 'f')))
|
else
|
||||||
continue;
|
{
|
||||||
|
u64 index = atoll(tail);
|
||||||
|
|
||||||
|
if (c->is6 &&
|
||||||
|
index <= addr6part(&c->end6) - addr6part(&c->start6))
|
||||||
|
{
|
||||||
|
u64 start = addr6part(&c->start6);
|
||||||
|
addr->addr.addr6 = c->start6;
|
||||||
|
setaddr6part(&addr->addr.addr6, start + index);
|
||||||
|
found = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*p != '.')
|
|
||||||
continue;
|
|
||||||
|
|
||||||
*p = 0;
|
|
||||||
|
|
||||||
#ifdef HAVE_IPV6
|
|
||||||
if (prot == AF_INET6 && strstr(tail, "--ffff-") == tail)
|
|
||||||
{
|
|
||||||
/* special hack for v4-mapped. */
|
|
||||||
memcpy(tail, "::ffff:", 7);
|
|
||||||
for (p = tail + 7; *p; p++)
|
|
||||||
if (*p == '-')
|
|
||||||
*p = '.';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
/* swap . or : for - */
|
/* NB, must not alter name if we return zero */
|
||||||
for (p = tail; *p; p++)
|
for (p = tail; *p; p++)
|
||||||
if (*p == '-')
|
{
|
||||||
{
|
char c = *p;
|
||||||
if (prot == AF_INET)
|
|
||||||
|
if ((c >='0' && c <= '9') || c == '-')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
#ifdef HAVE_IPV6
|
||||||
|
if (prot == AF_INET6 && ((c >='A' && c <= 'F') || (c >='a' && c <= 'f')))
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*p != '.')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
*p = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_IPV6
|
||||||
|
if (prot == AF_INET6 && strstr(tail, "--ffff-") == tail)
|
||||||
|
{
|
||||||
|
/* special hack for v4-mapped. */
|
||||||
|
memcpy(tail, "::ffff:", 7);
|
||||||
|
for (p = tail + 7; *p; p++)
|
||||||
|
if (*p == '-')
|
||||||
*p = '.';
|
*p = '.';
|
||||||
#ifdef HAVE_IPV6
|
|
||||||
else
|
|
||||||
*p = ':';
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hostname_isequal(c->domain, p+1) && inet_pton(prot, tail, addr))
|
|
||||||
{
|
|
||||||
if (prot == AF_INET)
|
|
||||||
{
|
|
||||||
if (!c->is6 &&
|
|
||||||
ntohl(addr->addr.addr4.s_addr) >= ntohl(c->start.s_addr) &&
|
|
||||||
ntohl(addr->addr.addr4.s_addr) <= ntohl(c->end.s_addr))
|
|
||||||
found = 1;
|
|
||||||
}
|
}
|
||||||
#ifdef HAVE_IPV6
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
u64 addrpart = addr6part(&addr->addr.addr6);
|
|
||||||
|
|
||||||
if (c->is6 &&
|
|
||||||
is_same_net6(&addr->addr.addr6, &c->start6, 64) &&
|
|
||||||
addrpart >= addr6part(&c->start6) &&
|
|
||||||
addrpart <= addr6part(&c->end6))
|
|
||||||
found = 1;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
/* swap . or : for - */
|
||||||
|
for (p = tail; *p; p++)
|
||||||
|
if (*p == '-')
|
||||||
|
{
|
||||||
|
if (prot == AF_INET)
|
||||||
|
*p = '.';
|
||||||
|
#ifdef HAVE_IPV6
|
||||||
|
else
|
||||||
|
*p = ':';
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hostname_isequal(c->domain, p+1) && inet_pton(prot, tail, addr))
|
||||||
|
{
|
||||||
|
if (prot == AF_INET)
|
||||||
|
{
|
||||||
|
if (!c->is6 &&
|
||||||
|
ntohl(addr->addr.addr4.s_addr) >= ntohl(c->start.s_addr) &&
|
||||||
|
ntohl(addr->addr.addr4.s_addr) <= ntohl(c->end.s_addr))
|
||||||
|
found = 1;
|
||||||
|
}
|
||||||
|
#ifdef HAVE_IPV6
|
||||||
|
else
|
||||||
|
{
|
||||||
|
u64 addrpart = addr6part(&addr->addr.addr6);
|
||||||
|
|
||||||
|
if (c->is6 &&
|
||||||
|
is_same_net6(&addr->addr.addr6, &c->start6, 64) &&
|
||||||
|
addrpart >= addr6part(&c->start6) &&
|
||||||
|
addrpart <= addr6part(&c->end6))
|
||||||
|
found = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* restore name */
|
/* restore name */
|
||||||
@@ -132,6 +181,7 @@ int is_name_synthetic(int flags, char *name, struct all_addr *addr)
|
|||||||
|
|
||||||
*p = '.';
|
*p = '.';
|
||||||
|
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -149,13 +199,21 @@ int is_rev_synth(int flag, struct all_addr *addr, char *name)
|
|||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
*name = 0;
|
*name = 0;
|
||||||
if (c->prefix)
|
if (c->indexed)
|
||||||
strncpy(name, c->prefix, MAXDNAME - ADDRSTRLEN);
|
{
|
||||||
|
unsigned int index = ntohl(addr->addr.addr4.s_addr) - ntohl(c->start.s_addr);
|
||||||
|
snprintf(name, MAXDNAME, "%s%u", c->prefix ? c->prefix : "", index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (c->prefix)
|
||||||
|
strncpy(name, c->prefix, MAXDNAME - ADDRSTRLEN);
|
||||||
|
|
||||||
inet_ntop(AF_INET, &addr->addr.addr4, name + strlen(name), ADDRSTRLEN);
|
inet_ntop(AF_INET, &addr->addr.addr4, name + strlen(name), ADDRSTRLEN);
|
||||||
for (p = name; *p; p++)
|
for (p = name; *p; p++)
|
||||||
if (*p == '.')
|
if (*p == '.')
|
||||||
*p = '-';
|
*p = '-';
|
||||||
|
}
|
||||||
|
|
||||||
strncat(name, ".", MAXDNAME);
|
strncat(name, ".", MAXDNAME);
|
||||||
strncat(name, c->domain, MAXDNAME);
|
strncat(name, c->domain, MAXDNAME);
|
||||||
@@ -169,23 +227,32 @@ int is_rev_synth(int flag, struct all_addr *addr, char *name)
|
|||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
*name = 0;
|
*name = 0;
|
||||||
if (c->prefix)
|
if (c->indexed)
|
||||||
strncpy(name, c->prefix, MAXDNAME - ADDRSTRLEN);
|
|
||||||
|
|
||||||
inet_ntop(AF_INET6, &addr->addr.addr6, name + strlen(name), ADDRSTRLEN);
|
|
||||||
|
|
||||||
/* IPv6 presentation address can start with ":", but valid domain names
|
|
||||||
cannot start with "-" so prepend a zero in that case. */
|
|
||||||
if (!c->prefix && *name == ':')
|
|
||||||
{
|
{
|
||||||
*name = '0';
|
u64 index = addr6part(&addr->addr.addr6) - addr6part(&c->start6);
|
||||||
inet_ntop(AF_INET6, &addr->addr.addr6, name+1, ADDRSTRLEN);
|
snprintf(name, MAXDNAME, "%s%llu", c->prefix ? c->prefix : "", index);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (c->prefix)
|
||||||
|
strncpy(name, c->prefix, MAXDNAME - ADDRSTRLEN);
|
||||||
|
|
||||||
/* V4-mapped have periods.... */
|
inet_ntop(AF_INET6, &addr->addr.addr6, name + strlen(name), ADDRSTRLEN);
|
||||||
for (p = name; *p; p++)
|
|
||||||
if (*p == ':' || *p == '.')
|
/* IPv6 presentation address can start with ":", but valid domain names
|
||||||
*p = '-';
|
cannot start with "-" so prepend a zero in that case. */
|
||||||
|
if (!c->prefix && *name == ':')
|
||||||
|
{
|
||||||
|
*name = '0';
|
||||||
|
inet_ntop(AF_INET6, &addr->addr.addr6, name+1, ADDRSTRLEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* V4-mapped have periods.... */
|
||||||
|
for (p = name; *p; p++)
|
||||||
|
if (*p == ':' || *p == '.')
|
||||||
|
*p = '-';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
strncat(name, ".", MAXDNAME);
|
strncat(name, ".", MAXDNAME);
|
||||||
strncat(name, c->domain, MAXDNAME);
|
strncat(name, c->domain, MAXDNAME);
|
||||||
|
|||||||
+100
-74
@@ -1163,7 +1163,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
|
|||||||
case 'd':
|
case 'd':
|
||||||
case 'D':
|
case 'D':
|
||||||
fac *= 24;
|
fac *= 24;
|
||||||
/* fall though */
|
/* fall through */
|
||||||
case 'h':
|
case 'h':
|
||||||
case 'H':
|
case 'H':
|
||||||
fac *= 60;
|
fac *= 60;
|
||||||
@@ -2071,6 +2071,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
|||||||
char *netpart;
|
char *netpart;
|
||||||
|
|
||||||
new->prefix = NULL;
|
new->prefix = NULL;
|
||||||
|
new->indexed = 0;
|
||||||
|
|
||||||
unhide_metas(comma);
|
unhide_metas(comma);
|
||||||
if ((netpart = split_chr(comma, '/')))
|
if ((netpart = split_chr(comma, '/')))
|
||||||
@@ -2208,8 +2209,14 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
char *star;
|
||||||
new->next = daemon->synth_domains;
|
new->next = daemon->synth_domains;
|
||||||
daemon->synth_domains = new;
|
daemon->synth_domains = new;
|
||||||
|
if ((star = strrchr(new->prefix, '*')) && *(star+1) == 0)
|
||||||
|
{
|
||||||
|
*star = 0;
|
||||||
|
new->indexed = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (option == 's')
|
else if (option == 's')
|
||||||
@@ -2970,7 +2977,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
|||||||
case 'd':
|
case 'd':
|
||||||
case 'D':
|
case 'D':
|
||||||
fac *= 24;
|
fac *= 24;
|
||||||
/* fall though */
|
/* fall through */
|
||||||
case 'h':
|
case 'h':
|
||||||
case 'H':
|
case 'H':
|
||||||
fac *= 60;
|
fac *= 60;
|
||||||
@@ -3856,6 +3863,7 @@ err:
|
|||||||
|
|
||||||
while (arg != last)
|
while (arg != last)
|
||||||
{
|
{
|
||||||
|
int arglen = strlen(arg);
|
||||||
alias = canonicalise_opt(arg);
|
alias = canonicalise_opt(arg);
|
||||||
|
|
||||||
if (!alias || !target)
|
if (!alias || !target)
|
||||||
@@ -3871,7 +3879,7 @@ err:
|
|||||||
new->target = target;
|
new->target = target;
|
||||||
new->ttl = ttl;
|
new->ttl = ttl;
|
||||||
|
|
||||||
for (arg += strlen(arg)+1; *arg == ' '; arg++);
|
for (arg += arglen+1; *arg && isspace(*arg); arg++);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -4327,7 +4335,7 @@ static void read_file(char *file, FILE *f, int hard_opt)
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
#if defined(HAVE_DHCP) && defined(HAVE_INOTIFY)
|
||||||
int option_read_dynfile(char *file, int flags)
|
int option_read_dynfile(char *file, int flags)
|
||||||
{
|
{
|
||||||
my_syslog(MS_DHCP | LOG_INFO, _("read %s"), file);
|
my_syslog(MS_DHCP | LOG_INFO, _("read %s"), file);
|
||||||
@@ -4528,86 +4536,99 @@ void read_servers_file(void)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
|
static void clear_dynamic_conf(void)
|
||||||
|
{
|
||||||
|
struct dhcp_config *configs, *cp, **up;
|
||||||
|
|
||||||
|
/* remove existing... */
|
||||||
|
for (up = &daemon->dhcp_conf, configs = daemon->dhcp_conf; configs; configs = cp)
|
||||||
|
{
|
||||||
|
cp = configs->next;
|
||||||
|
|
||||||
|
if (configs->flags & CONFIG_BANK)
|
||||||
|
{
|
||||||
|
struct hwaddr_config *mac, *tmp;
|
||||||
|
struct dhcp_netid_list *list, *tmplist;
|
||||||
|
|
||||||
|
for (mac = configs->hwaddr; mac; mac = tmp)
|
||||||
|
{
|
||||||
|
tmp = mac->next;
|
||||||
|
free(mac);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configs->flags & CONFIG_CLID)
|
||||||
|
free(configs->clid);
|
||||||
|
|
||||||
|
for (list = configs->netid; list; list = tmplist)
|
||||||
|
{
|
||||||
|
free(list->list);
|
||||||
|
tmplist = list->next;
|
||||||
|
free(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configs->flags & CONFIG_NAME)
|
||||||
|
free(configs->hostname);
|
||||||
|
|
||||||
|
*up = configs->next;
|
||||||
|
free(configs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
up = &configs->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void clear_dynamic_opt(void)
|
||||||
|
{
|
||||||
|
struct dhcp_opt *opts, *cp, **up;
|
||||||
|
struct dhcp_netid *id, *next;
|
||||||
|
|
||||||
|
for (up = &daemon->dhcp_opts, opts = daemon->dhcp_opts; opts; opts = cp)
|
||||||
|
{
|
||||||
|
cp = opts->next;
|
||||||
|
|
||||||
|
if (opts->flags & DHOPT_BANK)
|
||||||
|
{
|
||||||
|
if ((opts->flags & DHOPT_VENDOR))
|
||||||
|
free(opts->u.vendor_class);
|
||||||
|
free(opts->val);
|
||||||
|
for (id = opts->netid; id; id = next)
|
||||||
|
{
|
||||||
|
next = id->next;
|
||||||
|
free(id->net);
|
||||||
|
free(id);
|
||||||
|
}
|
||||||
|
*up = opts->next;
|
||||||
|
free(opts);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
up = &opts->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void reread_dhcp(void)
|
void reread_dhcp(void)
|
||||||
{
|
{
|
||||||
struct hostsfile *hf;
|
struct hostsfile *hf;
|
||||||
|
|
||||||
if (daemon->dhcp_hosts_file)
|
/* Do these even if there is no daemon->dhcp_hosts_file or
|
||||||
|
daemon->dhcp_opts_file since entries may have been created by the
|
||||||
|
inotify dynamic file reading system. */
|
||||||
|
|
||||||
|
clear_dynamic_conf();
|
||||||
|
clear_dynamic_opt();
|
||||||
|
|
||||||
|
if (daemon->dhcp_hosts_file)
|
||||||
{
|
{
|
||||||
struct dhcp_config *configs, *cp, **up;
|
|
||||||
|
|
||||||
/* remove existing... */
|
|
||||||
for (up = &daemon->dhcp_conf, configs = daemon->dhcp_conf; configs; configs = cp)
|
|
||||||
{
|
|
||||||
cp = configs->next;
|
|
||||||
|
|
||||||
if (configs->flags & CONFIG_BANK)
|
|
||||||
{
|
|
||||||
struct hwaddr_config *mac, *tmp;
|
|
||||||
struct dhcp_netid_list *list, *tmplist;
|
|
||||||
|
|
||||||
for (mac = configs->hwaddr; mac; mac = tmp)
|
|
||||||
{
|
|
||||||
tmp = mac->next;
|
|
||||||
free(mac);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configs->flags & CONFIG_CLID)
|
|
||||||
free(configs->clid);
|
|
||||||
|
|
||||||
for (list = configs->netid; list; list = tmplist)
|
|
||||||
{
|
|
||||||
free(list->list);
|
|
||||||
tmplist = list->next;
|
|
||||||
free(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configs->flags & CONFIG_NAME)
|
|
||||||
free(configs->hostname);
|
|
||||||
|
|
||||||
*up = configs->next;
|
|
||||||
free(configs);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
up = &configs->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
daemon->dhcp_hosts_file = expand_filelist(daemon->dhcp_hosts_file);
|
daemon->dhcp_hosts_file = expand_filelist(daemon->dhcp_hosts_file);
|
||||||
for (hf = daemon->dhcp_hosts_file; hf; hf = hf->next)
|
for (hf = daemon->dhcp_hosts_file; hf; hf = hf->next)
|
||||||
if (!(hf->flags & AH_INACTIVE))
|
if (!(hf->flags & AH_INACTIVE))
|
||||||
{
|
{
|
||||||
if (one_file(hf->fname, LOPT_BANK))
|
if (one_file(hf->fname, LOPT_BANK))
|
||||||
my_syslog(MS_DHCP | LOG_INFO, _("read %s"), hf->fname);
|
my_syslog(MS_DHCP | LOG_INFO, _("read %s"), hf->fname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (daemon->dhcp_opts_file)
|
if (daemon->dhcp_opts_file)
|
||||||
{
|
{
|
||||||
struct dhcp_opt *opts, *cp, **up;
|
|
||||||
struct dhcp_netid *id, *next;
|
|
||||||
|
|
||||||
for (up = &daemon->dhcp_opts, opts = daemon->dhcp_opts; opts; opts = cp)
|
|
||||||
{
|
|
||||||
cp = opts->next;
|
|
||||||
|
|
||||||
if (opts->flags & DHOPT_BANK)
|
|
||||||
{
|
|
||||||
if ((opts->flags & DHOPT_VENDOR))
|
|
||||||
free(opts->u.vendor_class);
|
|
||||||
free(opts->val);
|
|
||||||
for (id = opts->netid; id; id = next)
|
|
||||||
{
|
|
||||||
next = id->next;
|
|
||||||
free(id->net);
|
|
||||||
free(id);
|
|
||||||
}
|
|
||||||
*up = opts->next;
|
|
||||||
free(opts);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
up = &opts->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
daemon->dhcp_opts_file = expand_filelist(daemon->dhcp_opts_file);
|
daemon->dhcp_opts_file = expand_filelist(daemon->dhcp_opts_file);
|
||||||
for (hf = daemon->dhcp_opts_file; hf; hf = hf->next)
|
for (hf = daemon->dhcp_opts_file; hf; hf = hf->next)
|
||||||
if (!(hf->flags & AH_INACTIVE))
|
if (!(hf->flags & AH_INACTIVE))
|
||||||
@@ -4616,6 +4637,11 @@ void reread_dhcp(void)
|
|||||||
my_syslog(MS_DHCP | LOG_INFO, _("read %s"), hf->fname);
|
my_syslog(MS_DHCP | LOG_INFO, _("read %s"), hf->fname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef HAVE_INOTIFY
|
||||||
|
/* Setup notify and read pre-existing files. */
|
||||||
|
set_dynamic_inotify(AH_DHCP_HST | AH_DHCP_OPT, 0, NULL, 0);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user