mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-06 15:51:41 +00:00
Compare commits
13
Commits
v2.63rc4
...
v2.64test3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d0f5b4c44 | ||
|
|
1dedeb87cc | ||
|
|
79cfefd856 | ||
|
|
0c0d4793ac | ||
|
|
12d71ed28c | ||
|
|
9fed0f71c2 | ||
|
|
2e34ac1403 | ||
|
|
bc54ae392b | ||
|
|
00acd06340 | ||
|
|
476e4a03c1 | ||
|
|
5f11b3e5e0 | ||
|
|
3169daad46 | ||
|
|
fd05f12790 |
No files matched your search
@@ -1,3 +1,19 @@
|
|||||||
|
version 2.64
|
||||||
|
Handle DHCP FQDN options with all flag bits zero and
|
||||||
|
--dhcp-client-update set. Thanks to Bernd Krumbroeck for
|
||||||
|
spotting the problem.
|
||||||
|
|
||||||
|
Finesse the check for /etc/hosts names which conflict with
|
||||||
|
DHCP names. Previously a name/address pair in /etc/hosts
|
||||||
|
which didn't match the name/address of a DHCP lease would
|
||||||
|
generate a warning. Now that only happesn if there is not
|
||||||
|
also a match. This allows multiple addresses for a name in
|
||||||
|
/etc/hosts with one of them assigned via DHCP.
|
||||||
|
|
||||||
|
Fix broken vendor-option processing for BOOTP. Thanks to
|
||||||
|
Hans-Joachim Baader for the bug report.
|
||||||
|
|
||||||
|
|
||||||
version 2.63
|
version 2.63
|
||||||
Do duplicate dhcp-host address check in --test mode.
|
Do duplicate dhcp-host address check in --test mode.
|
||||||
|
|
||||||
@@ -45,6 +61,9 @@ version 2.63
|
|||||||
uk.org.thekelleys.dnsmasq. Thanks to Mathieu
|
uk.org.thekelleys.dnsmasq. Thanks to Mathieu
|
||||||
Trudel-Lapierre for the patch.
|
Trudel-Lapierre for the patch.
|
||||||
|
|
||||||
|
Set the "prefix on-link" bit in Router
|
||||||
|
Advertisements. Thanks to Gui Iribarren for the patch.
|
||||||
|
|
||||||
|
|
||||||
version 2.62
|
version 2.62
|
||||||
Update German translation. Thanks to Conrad Kostecki.
|
Update German translation. Thanks to Conrad Kostecki.
|
||||||
|
|||||||
+3
-1
@@ -8,6 +8,8 @@
|
|||||||
# which has a set of references substituted into it by git.
|
# which has a set of references substituted into it by git.
|
||||||
# If we can find one which matches $v[0-9].* then we assume it's
|
# If we can find one which matches $v[0-9].* then we assume it's
|
||||||
# a version-number tag, else we just use the whole string.
|
# a version-number tag, else we just use the whole string.
|
||||||
|
# If there is more than one v[0-9].* tag, sort them and use the
|
||||||
|
# first. This favours, eg v2.63 over 2.63rc6.
|
||||||
|
|
||||||
if which git >/dev/null 2>&1 && [ -d $1/.git ]; then
|
if which git >/dev/null 2>&1 && [ -d $1/.git ]; then
|
||||||
cd $1; git describe
|
cd $1; git describe
|
||||||
@@ -18,7 +20,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 | sed 's/^v//'
|
echo "${vers}" | sort | head -n 1 | sed 's/^v//'
|
||||||
else
|
else
|
||||||
cat $1/VERSION
|
cat $1/VERSION
|
||||||
fi
|
fi
|
||||||
|
|||||||
Vendored
+22
@@ -1,3 +1,25 @@
|
|||||||
|
dnsmasq (2.64-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream.
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Tue, 4 Sep 2012 21:50:22 +0000
|
||||||
|
|
||||||
|
dnsmasq (2.63-3) unstable; urgency=low
|
||||||
|
|
||||||
|
* Move adduser dependency to dnsmasq-base. (closes: #686694)
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Tue, 4 Sep 2012 21:44:15 +0000
|
||||||
|
|
||||||
|
dnsmasq (2.63-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Fix version script to report correct version.
|
||||||
|
* Unbotch move of dbus config file by using correct versions in
|
||||||
|
Replaces: and Breaks: lines. (closes: #685204)
|
||||||
|
* Create dnsmasq user in dnsmasq-base so that Dbus doesn't complain if
|
||||||
|
only dnsmasq-base is installed. (closes: #685987)
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Tue, 28 Aug 2012 16:18:35 +0000
|
||||||
|
|
||||||
dnsmasq (2.63-1) unstable; urgency=low
|
dnsmasq (2.63-1) unstable; urgency=low
|
||||||
|
|
||||||
* New upstream.
|
* New upstream.
|
||||||
|
|||||||
Vendored
+4
-4
@@ -7,7 +7,7 @@ Standards-Version: 3.9.3
|
|||||||
|
|
||||||
Package: dnsmasq
|
Package: dnsmasq
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: netbase, adduser, dnsmasq-base(>= ${source:Version})
|
Depends: netbase, dnsmasq-base(>= ${source:Version})
|
||||||
Suggests: resolvconf
|
Suggests: resolvconf
|
||||||
Conflicts: resolvconf (<<1.15)
|
Conflicts: resolvconf (<<1.15)
|
||||||
Description: Small caching DNS proxy and DHCP/TFTP server
|
Description: Small caching DNS proxy and DHCP/TFTP server
|
||||||
@@ -22,9 +22,9 @@ Description: Small caching DNS proxy and DHCP/TFTP server
|
|||||||
|
|
||||||
Package: dnsmasq-base
|
Package: dnsmasq-base
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}
|
Depends: adduser, ${shlibs:Depends}
|
||||||
Breaks: dnsmasq (<< 2.62-3)
|
Breaks: dnsmasq (<< 2.63-1~)
|
||||||
Replaces: dnsmasq (<< 2.62-3)
|
Replaces: dnsmasq (<< 2.63-1~)
|
||||||
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
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Create the dnsmasq user in dnsmasq-base, so that Dbus doesn't complain.
|
||||||
|
|
||||||
|
# create a user to run as (code stolen from dovecot-common)
|
||||||
|
if [ "$1" = "configure" ]; then
|
||||||
|
if [ -z "`id -u dnsmasq 2> /dev/null`" ]; then
|
||||||
|
adduser --system --home /var/lib/misc --gecos "dnsmasq" \
|
||||||
|
--no-create-home --disabled-password \
|
||||||
|
--quiet dnsmasq || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make the directory where we keep the pid file - this
|
||||||
|
# has to be owned by "dnsmasq" so that the file can be unlinked.
|
||||||
|
# This is only actually used by the dnsmasq binary package, not
|
||||||
|
# dnsmasq-base, but it's much easier to create it here so that
|
||||||
|
# we don't have synchronisation issues with the creation of the
|
||||||
|
# dnsmasq user.
|
||||||
|
if [ ! -d /var/run/dnsmasq ]; then
|
||||||
|
mkdir /var/run/dnsmasq
|
||||||
|
chown dnsmasq:nogroup /var/run/dnsmasq
|
||||||
|
fi
|
||||||
|
fi
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ purge = "$1" ]; then
|
||||||
|
if [ -x "$(command -v deluser)" ]; then
|
||||||
|
deluser --quiet --system dnsmasq > /dev/null || true
|
||||||
|
else
|
||||||
|
echo >&2 "not removing dnsmasq system account because deluser command was not found"
|
||||||
|
fi
|
||||||
|
rm -rf /var/run/dnsmasq
|
||||||
|
fi
|
||||||
Vendored
-27
@@ -1,27 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# create a user to run as (code stolen from dovecot-common)
|
|
||||||
if [ "$1" = "configure" ]; then
|
|
||||||
if [ -z "`id -u dnsmasq 2> /dev/null`" ]; then
|
|
||||||
adduser --system --home /var/lib/misc --gecos "dnsmasq" \
|
|
||||||
--no-create-home --disabled-password \
|
|
||||||
--quiet dnsmasq || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make the directory where we keep the pid file - this
|
|
||||||
# has to be owned by "dnsmasq" do that the file can be unlinked.
|
|
||||||
if [ ! -d /var/run/dnsmasq ]; then
|
|
||||||
mkdir /var/run/dnsmasq
|
|
||||||
chown dnsmasq:nogroup /var/run/dnsmasq
|
|
||||||
fi
|
|
||||||
|
|
||||||
# handle new location of pidfile during an upgrade
|
|
||||||
if [ -e /var/run/dnsmasq.pid ]; then
|
|
||||||
mv /var/run/dnsmasq.pid /var/run/dnsmasq
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x /etc/init.d/dnsmasq ]; then
|
if [ -x /etc/init.d/dnsmasq ]; then
|
||||||
update-rc.d dnsmasq defaults 15 85 >/dev/null
|
update-rc.d dnsmasq defaults 15 85 >/dev/null
|
||||||
|
|
||||||
@@ -40,10 +19,4 @@ if [ -x /etc/init.d/dnsmasq ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# dpkg can botch the change of /usr/share/doc/dnsmasq from
|
|
||||||
# directory to symlink. Fix up here.
|
|
||||||
if [ ! -h /usr/share/doc/dnsmasq ] && { rmdir /usr/share/doc/dnsmasq; }; then
|
|
||||||
cd /usr/share/doc/
|
|
||||||
ln -s /usr/share/doc/dnsmasq-base dnsmasq
|
|
||||||
fi
|
|
||||||
|
|
||||||
Vendored
-6
@@ -3,10 +3,4 @@ set -e
|
|||||||
|
|
||||||
if [ purge = "$1" ]; then
|
if [ purge = "$1" ]; then
|
||||||
update-rc.d dnsmasq remove >/dev/null
|
update-rc.d dnsmasq remove >/dev/null
|
||||||
if [ -x "$(command -v deluser)" ]; then
|
|
||||||
deluser --quiet --system dnsmasq > /dev/null || true
|
|
||||||
else
|
|
||||||
echo >&2 "not removing dnsmasq system account because deluser command was not found"
|
|
||||||
fi
|
|
||||||
rm -rf /var/run/dnsmasq
|
|
||||||
fi
|
fi
|
||||||
Vendored
+2
@@ -129,6 +129,8 @@ ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
|
|||||||
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/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
|
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
|
||||||
|
|||||||
+34
-28
@@ -1042,7 +1042,7 @@ static void add_dhcp_cname(struct crec *target, time_t 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;
|
struct crec *crec = NULL, *fail_crec = NULL;
|
||||||
unsigned short flags = F_IPV4;
|
unsigned short flags = F_IPV4;
|
||||||
int in_hosts = 0;
|
int in_hosts = 0;
|
||||||
size_t addrlen = sizeof(struct in_addr);
|
size_t addrlen = sizeof(struct in_addr);
|
||||||
@@ -1055,28 +1055,21 @@ void cache_add_dhcp_entry(char *host_name, int prot,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inet_ntop(prot, host_address, daemon->addrbuff, ADDRSTRLEN);
|
||||||
|
|
||||||
while ((crec = cache_find_by_name(crec, host_name, 0, flags | F_CNAME)))
|
while ((crec = cache_find_by_name(crec, host_name, 0, flags | F_CNAME)))
|
||||||
{
|
{
|
||||||
/* check all addresses associated with name */
|
/* check all addresses associated with name */
|
||||||
if (crec->flags & F_HOSTS)
|
if (crec->flags & F_HOSTS)
|
||||||
{
|
{
|
||||||
/* if in hosts, don't need DHCP record */
|
|
||||||
in_hosts = 1;
|
|
||||||
|
|
||||||
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);
|
||||||
else if (memcmp(&crec->addr.addr, host_address, addrlen) != 0)
|
else if (memcmp(&crec->addr.addr, host_address, addrlen) == 0)
|
||||||
{
|
in_hosts = 1;
|
||||||
inet_ntop(prot, &crec->addr.addr, daemon->namebuff, MAXDNAME);
|
else
|
||||||
my_syslog(MS_DHCP | LOG_WARNING,
|
fail_crec = crec;
|
||||||
_("not giving name %s to the DHCP lease of %s because "
|
|
||||||
"the name exists in %s with address %s"),
|
|
||||||
host_name, daemon->addrbuff,
|
|
||||||
record_source(crec->uid), daemon->namebuff);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (!(crec->flags & F_DHCP))
|
else if (!(crec->flags & F_DHCP))
|
||||||
{
|
{
|
||||||
@@ -1086,21 +1079,34 @@ void cache_add_dhcp_entry(char *host_name, int prot,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_hosts)
|
/* if in hosts, don't need DHCP record */
|
||||||
|
if (in_hosts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((crec = cache_find_by_addr(NULL, (struct all_addr *)host_address, 0, flags)))
|
/* Name in hosts, address doesn't match */
|
||||||
{
|
if (fail_crec)
|
||||||
if (crec->flags & F_NEG)
|
{
|
||||||
{
|
inet_ntop(prot, &fail_crec->addr.addr, daemon->namebuff, MAXDNAME);
|
||||||
flags |= F_REVERSE;
|
my_syslog(MS_DHCP | LOG_WARNING,
|
||||||
cache_scan_free(NULL, (struct all_addr *)host_address, 0, flags);
|
_("not giving name %s to the DHCP lease of %s because "
|
||||||
}
|
"the name exists in %s with address %s"),
|
||||||
}
|
host_name, daemon->addrbuff,
|
||||||
else
|
record_source(fail_crec->uid), daemon->namebuff);
|
||||||
flags |= F_REVERSE;
|
return;
|
||||||
|
}
|
||||||
if ((crec = dhcp_spare))
|
|
||||||
|
if ((crec = cache_find_by_addr(NULL, (struct all_addr *)host_address, 0, flags)))
|
||||||
|
{
|
||||||
|
if (crec->flags & F_NEG)
|
||||||
|
{
|
||||||
|
flags |= F_REVERSE;
|
||||||
|
cache_scan_free(NULL, (struct all_addr *)host_address, 0, flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flags |= F_REVERSE;
|
||||||
|
|
||||||
|
if ((crec = dhcp_spare))
|
||||||
dhcp_spare = dhcp_spare->next;
|
dhcp_spare = dhcp_spare->next;
|
||||||
else /* need new one */
|
else /* need new one */
|
||||||
crec = whine_malloc(sizeof(struct crec));
|
crec = whine_malloc(sizeof(struct crec));
|
||||||
|
|||||||
+44
-13
@@ -383,15 +383,48 @@ int main (int argc, char **argv)
|
|||||||
/* write pidfile _after_ forking ! */
|
/* write pidfile _after_ forking ! */
|
||||||
if (daemon->runfile)
|
if (daemon->runfile)
|
||||||
{
|
{
|
||||||
FILE *pidfile;
|
int fd, err = 0;
|
||||||
|
|
||||||
|
sprintf(daemon->namebuff, "%d\n", (int) getpid());
|
||||||
|
|
||||||
|
/* Explanation: Some installations of dnsmasq (eg Debian/Ubuntu) locate the pid-file
|
||||||
|
in a directory which is writable by the non-privileged user that dnsmasq runs as. This
|
||||||
|
allows the daemon to delete the file as part of its shutdown. This is a security hole to the
|
||||||
|
extent that an attacker running as the unprivileged user could replace the pidfile with a
|
||||||
|
symlink, and have the target of that symlink overwritten as root next time dnsmasq starts.
|
||||||
|
|
||||||
|
The folowing code first deletes any existing file, and then opens it with the O_EXCL flag,
|
||||||
|
ensuring that the open() fails should there be any existing file (because the unlink() failed,
|
||||||
|
or an attacker exploited the race between unlink() and open()). This ensures that no symlink
|
||||||
|
attack can succeed.
|
||||||
|
|
||||||
|
Any compromise of the non-privileged user still theoretically allows the pid-file to be
|
||||||
|
replaced whilst dnsmasq is running. The worst that could allow is that the usual
|
||||||
|
"shutdown dnsmasq" shell command could be tricked into stopping any other process.
|
||||||
|
|
||||||
|
Note that if dnsmasq is started as non-root (eg for testing) it silently ignores
|
||||||
|
failure to write the pid-file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
unlink(daemon->runfile);
|
||||||
|
|
||||||
/* only complain if started as root */
|
if ((fd = open(daemon->runfile, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH)) == -1)
|
||||||
if ((pidfile = fopen(daemon->runfile, "w")))
|
|
||||||
{
|
{
|
||||||
fprintf(pidfile, "%d\n", (int) getpid());
|
/* only complain if started as root */
|
||||||
fclose(pidfile);
|
if (getuid() == 0)
|
||||||
|
err = 1;
|
||||||
}
|
}
|
||||||
else if (getuid() == 0)
|
else
|
||||||
|
{
|
||||||
|
if (!read_write(fd, (unsigned char *)daemon->namebuff, strlen(daemon->namebuff), 0))
|
||||||
|
err = 1;
|
||||||
|
|
||||||
|
while (!err && close(fd) == -1)
|
||||||
|
if (!retry_send())
|
||||||
|
err = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err)
|
||||||
{
|
{
|
||||||
send_event(err_pipe[1], EVENT_PIDFILE, errno, daemon->runfile);
|
send_event(err_pipe[1], EVENT_PIDFILE, errno, daemon->runfile);
|
||||||
_exit(0);
|
_exit(0);
|
||||||
@@ -607,7 +640,7 @@ int main (int argc, char **argv)
|
|||||||
end = &dhcp_tmp->end6;
|
end = &dhcp_tmp->end6;
|
||||||
struct in6_addr subnet = dhcp_tmp->start6;
|
struct in6_addr subnet = dhcp_tmp->start6;
|
||||||
setaddr6part(&subnet, 0);
|
setaddr6part(&subnet, 0);
|
||||||
inet_ntop(AF_INET6, &subnet, daemon->addrbuff, 256);
|
inet_ntop(AF_INET6, &subnet, daemon->dhcp_buff2, 256);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -620,10 +653,8 @@ int main (int argc, char **argv)
|
|||||||
prettyprint_time(p, dhcp_tmp->lease_time);
|
prettyprint_time(p, dhcp_tmp->lease_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (daemon->dhcp_buff)
|
inet_ntop(family, start, daemon->dhcp_buff, 256);
|
||||||
inet_ntop(family, start, daemon->dhcp_buff, 256);
|
inet_ntop(family, end, daemon->dhcp_buff3, 256);
|
||||||
if (daemon->dhcp_buff3)
|
|
||||||
inet_ntop(family, end, daemon->dhcp_buff3, 256);
|
|
||||||
if ((dhcp_tmp->flags & CONTEXT_DHCP) || family == AF_INET)
|
if ((dhcp_tmp->flags & CONTEXT_DHCP) || family == AF_INET)
|
||||||
my_syslog(MS_DHCP | LOG_INFO,
|
my_syslog(MS_DHCP | LOG_INFO,
|
||||||
(dhcp_tmp->flags & CONTEXT_RA_STATELESS) ?
|
(dhcp_tmp->flags & CONTEXT_RA_STATELESS) ?
|
||||||
@@ -637,7 +668,7 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
if (dhcp_tmp->flags & CONTEXT_RA_NAME)
|
if (dhcp_tmp->flags & CONTEXT_RA_NAME)
|
||||||
my_syslog(MS_DHCP | LOG_INFO, _("DHCPv4-derived IPv6 names on %s"),
|
my_syslog(MS_DHCP | LOG_INFO, _("DHCPv4-derived IPv6 names on %s"),
|
||||||
daemon->addrbuff);
|
daemon->dhcp_buff2);
|
||||||
if (dhcp_tmp->flags & (CONTEXT_RA_ONLY | CONTEXT_RA_NAME | CONTEXT_RA_STATELESS))
|
if (dhcp_tmp->flags & (CONTEXT_RA_ONLY | CONTEXT_RA_NAME | CONTEXT_RA_STATELESS))
|
||||||
{
|
{
|
||||||
if (!(dhcp_tmp->flags & CONTEXT_DEPRECATE))
|
if (!(dhcp_tmp->flags & CONTEXT_DEPRECATE))
|
||||||
@@ -647,7 +678,7 @@ int main (int argc, char **argv)
|
|||||||
prettyprint_time(p, dhcp_tmp->lease_time > 7200 ? dhcp_tmp->lease_time : 7200);
|
prettyprint_time(p, dhcp_tmp->lease_time > 7200 ? dhcp_tmp->lease_time : 7200);
|
||||||
}
|
}
|
||||||
my_syslog(MS_DHCP | LOG_INFO, _("SLAAC on %s %s"),
|
my_syslog(MS_DHCP | LOG_INFO, _("SLAAC on %s %s"),
|
||||||
daemon->addrbuff, daemon->namebuff);
|
daemon->dhcp_buff2, daemon->namebuff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
-4
@@ -338,13 +338,22 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
|
|||||||
sprintf(daemon->addrbuff, "port %d", port);
|
sprintf(daemon->addrbuff, "port %d", port);
|
||||||
s = _("failed to create listening socket for %s: %s");
|
s = _("failed to create listening socket for %s: %s");
|
||||||
|
|
||||||
|
if (fd != -1)
|
||||||
|
close (fd);
|
||||||
|
|
||||||
if (dienow)
|
if (dienow)
|
||||||
die(s, daemon->addrbuff, EC_BADNET);
|
{
|
||||||
|
/* failure to bind addresses given by --listen-address at this point
|
||||||
|
is OK if we're doing bind-dynamic */
|
||||||
|
if (!option_bool(OPT_CLEVERBIND))
|
||||||
|
die(s, daemon->addrbuff, EC_BADNET);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
my_syslog(LOG_WARNING, s, daemon->addrbuff, strerror(errno));
|
||||||
|
|
||||||
my_syslog(LOG_ERR, s, daemon->addrbuff, strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || !fix_fd(fd))
|
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || !fix_fd(fd))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
@@ -513,7 +522,8 @@ void create_bound_listeners(int dienow)
|
|||||||
no interface with a matching address. These may be valid: eg it's possible
|
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
|
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().
|
If the address isn't valid the bind() will fail and we'll die()
|
||||||
|
(except in bind-dynamic mode, when we'll complain but keep trying.)
|
||||||
|
|
||||||
The resulting listeners have the ->iface field NULL, and this has to be
|
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
|
handled by the DNS and TFTP code. It disables --localise-queries processing
|
||||||
|
|||||||
+2
-2
@@ -412,8 +412,8 @@ static int add_prefixes(struct in6_addr *local, int prefix,
|
|||||||
opt->type = ICMP6_OPT_PREFIX;
|
opt->type = ICMP6_OPT_PREFIX;
|
||||||
opt->len = 4;
|
opt->len = 4;
|
||||||
opt->prefix_len = prefix;
|
opt->prefix_len = prefix;
|
||||||
/* autonomous only if we're not doing dhcp */
|
/* autonomous only if we're not doing dhcp, always set "on-link" */
|
||||||
opt->flags = do_slaac ? 0x40 : 0x00;
|
opt->flags = do_slaac ? 0xC0 : 0x80;
|
||||||
opt->valid_lifetime = htonl(time);
|
opt->valid_lifetime = htonl(time);
|
||||||
opt->preferred_lifetime = htonl(deprecate ? 0 : time);
|
opt->preferred_lifetime = htonl(deprecate ? 0 : time);
|
||||||
opt->reserved = 0;
|
opt->reserved = 0;
|
||||||
|
|||||||
+19
-7
@@ -493,8 +493,9 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
|
|||||||
lease_set_interface(lease, int_index, now);
|
lease_set_interface(lease, int_index, now);
|
||||||
|
|
||||||
clear_packet(mess, end);
|
clear_packet(mess, end);
|
||||||
|
match_vendor_opts(NULL, daemon->dhcp_opts); /* clear flags */
|
||||||
do_options(context, mess, end, NULL, hostname, get_domain(mess->yiaddr),
|
do_options(context, mess, end, NULL, hostname, get_domain(mess->yiaddr),
|
||||||
netid, subnet_addr, 0, 0, 0, NULL, 0, now);
|
netid, subnet_addr, 0, 0, -1, NULL, 0, now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,11 +516,22 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
|
|||||||
op += 3;
|
op += 3;
|
||||||
pp = op;
|
pp = op;
|
||||||
|
|
||||||
/* Always force update, since the client has no way to do it itself. */
|
/* NB, the following always sets at least one bit */
|
||||||
if (!option_bool(OPT_FQDN_UPDATE) && !(fqdn_flags & 0x01))
|
if (option_bool(OPT_FQDN_UPDATE))
|
||||||
fqdn_flags |= 0x03;
|
{
|
||||||
|
if (fqdn_flags & 0x01)
|
||||||
fqdn_flags &= ~0x08;
|
{
|
||||||
|
fqdn_flags |= 0x02; /* set O */
|
||||||
|
fqdn_flags &= ~0x01; /* clear S */
|
||||||
|
}
|
||||||
|
fqdn_flags |= 0x08; /* set N */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!(fqdn_flags & 0x01))
|
||||||
|
fqdn_flags |= 0x03; /* set S and O */
|
||||||
|
fqdn_flags &= ~0x08; /* clear N */
|
||||||
|
}
|
||||||
|
|
||||||
if (fqdn_flags & 0x04)
|
if (fqdn_flags & 0x04)
|
||||||
while (*op != 0 && ((op + (*op) + 1) - pp) < len)
|
while (*op != 0 && ((op + (*op) + 1) - pp) < len)
|
||||||
@@ -2261,7 +2273,7 @@ static void do_options(struct dhcp_context *context,
|
|||||||
|
|
||||||
if ((p = free_space(mess, end, OPTION_CLIENT_FQDN, len)))
|
if ((p = free_space(mess, end, OPTION_CLIENT_FQDN, len)))
|
||||||
{
|
{
|
||||||
*(p++) = fqdn_flags;
|
*(p++) = fqdn_flags & 0x0f; /* MBZ bits to zero */
|
||||||
*(p++) = 255;
|
*(p++) = 255;
|
||||||
*(p++) = 255;
|
*(p++) = 255;
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -113,7 +113,6 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct cmsghdr *cmptr;
|
struct cmsghdr *cmptr;
|
||||||
int check;
|
|
||||||
|
|
||||||
if (msg.msg_controllen < sizeof(struct cmsghdr))
|
if (msg.msg_controllen < sizeof(struct cmsghdr))
|
||||||
return;
|
return;
|
||||||
@@ -193,10 +192,14 @@ void tftp_request(struct listener *listen, time_t now)
|
|||||||
|
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if (listen->family == AF_INET6)
|
if (listen->family == AF_INET6)
|
||||||
check = iface_check(AF_INET6, (struct all_addr *)&addr.in6.sin6_addr, name);
|
{
|
||||||
|
if (!iface_check(AF_INET6, (struct all_addr *)&addr.in6.sin6_addr, name))
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
check = iface_check(AF_INET, (struct all_addr *)&addr.in.sin_addr, name);
|
if (!iface_check(AF_INET, (struct all_addr *)&addr.in.sin_addr, name))
|
||||||
|
return;
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
/* allowed interfaces are the same as for DHCP */
|
/* allowed interfaces are the same as for DHCP */
|
||||||
|
|||||||
Reference in new issue
Block a user