Compare commits

...
6 changed files with 26 additions and 15 deletions

No files matched your search

+5 -1
View File
@@ -101,7 +101,11 @@ version 2.67
(provide TFTP to the same interfaces we provide DHCP to) (provide TFTP to the same interfaces we provide DHCP to)
is retained. Thanks to Lonnie Abelbeck for the suggestion. is retained. Thanks to Lonnie Abelbeck for the suggestion.
Add --dhcp-relay config option. Add --dhcp-relay config option. Many thanks to vtsl.net
for sponsoring this development.
Fix crash with empty tag: in --dhcp-range. Thanks to
Kaspar Schleiser for the bug report.
version 2.66 version 2.66
+1
View File
@@ -1,6 +1,7 @@
dnsmasq (2.67-1) unstable; urgency=low dnsmasq (2.67-1) unstable; urgency=low
* New upstream. * New upstream.
* Update resolvconf script. (closes: #720732)
-- Simon Kelley <simon@thekelleys.org.uk> Wed, 4 Aug 2013 14:53:22 +0000 -- Simon Kelley <simon@thekelleys.org.uk> Wed, 4 Aug 2013 14:53:22 +0000
+7 -8
View File
@@ -16,8 +16,7 @@ set -e
RUN_DIR="/var/run/dnsmasq" RUN_DIR="/var/run/dnsmasq"
RSLVRLIST_FILE="${RUN_DIR}/resolv.conf" RSLVRLIST_FILE="${RUN_DIR}/resolv.conf"
TMP_FILE="${RSLVRLIST_FILE}_new.$$" TMP_FILE="${RSLVRLIST_FILE}_new.$$"
MY_RECORD_NAME="lo.dnsmasq" MY_NAME_FOR_RESOLVCONF="dnsmasq"
DNSCRYPT_RECORD_NAME="lo.dnscrypt"
[ -x /usr/sbin/dnsmasq ] || exit 0 [ -x /usr/sbin/dnsmasq ] || exit 0
[ -x /lib/resolvconf/list-records ] || exit 1 [ -x /lib/resolvconf/list-records ] || exit 1
@@ -46,14 +45,14 @@ if [ ! -d "$RUN_DIR" ] && ! mkdir --parents --mode=0755 "$RUN_DIR" ; then
fi fi
RSLVCNFFILES="" RSLVCNFFILES=""
for F in $(/lib/resolvconf/list-records --after "$MY_RECORD_NAME") ; do for F in $(/lib/resolvconf/list-records --after "lo.$MY_NAME_FOR_RESOLVCONF") ; do
case "$F" in case "$F" in
"$MY_RECORD_NAME") "lo.$MY_NAME_FOR_RESOLVCONF")
# Omit # Omit own record
;; ;;
"$DNSCRYPT_RECORD_NAME") lo.*)
# Dnscrypt, I only have eyes for you # Include no more records after one for a local nameserver
RSLVCNFFILES="$DNSCRYPT_RECORD_NAME" RSLVCNFFILES="${RSLVCNFFILES:+$RSLVCNFFILES }$F"
break break
;; ;;
*) *)
+4 -3
View File
@@ -237,16 +237,17 @@ int main (int argc, char **argv)
#if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP) #if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP)
/* after enumerate_interfaces() */ /* after enumerate_interfaces() */
if (daemon->dhcp || daemon->relay4) if (daemon->dhcp)
{ {
bindtodevice(daemon->dhcpfd); if (!daemon->relay4)
bindtodevice(daemon->dhcpfd);
if (daemon->enable_pxe) if (daemon->enable_pxe)
bindtodevice(daemon->pxefd); bindtodevice(daemon->pxefd);
} }
#endif #endif
#if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP6) #if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP6)
if (daemon->doing_dhcp6 || daemon->relay6) if (daemon->doing_dhcp6 && !daemon->relay6)
bindtodevice(daemon->dhcp6fd); bindtodevice(daemon->dhcp6fd);
#endif #endif
} }
+6 -2
View File
@@ -443,7 +443,7 @@ static int iface_allowed_v4(struct in_addr local, int if_index, char *label,
int enumerate_interfaces(int reset) int enumerate_interfaces(int reset)
{ {
static struct addrlist *spare = NULL; static struct addrlist *spare = NULL;
static int done = 0; static int done = 0, active = 0;
struct iface_param param; struct iface_param param;
int errsave, ret = 1; int errsave, ret = 1;
struct addrlist *addr, *tmp; struct addrlist *addr, *tmp;
@@ -458,11 +458,14 @@ int enumerate_interfaces(int reset)
return 1; return 1;
} }
if (done) if (done || active)
return 1; return 1;
done = 1; done = 1;
/* protect against recusive calls from iface_enumerate(); */
active = 1;
if ((param.fd = socket(PF_INET, SOCK_DGRAM, 0)) == -1) if ((param.fd = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
return 0; return 0;
@@ -504,6 +507,7 @@ int enumerate_interfaces(int reset)
errno = errsave; errno = errsave;
spare = param.spare; spare = param.spare;
active = 0;
return ret; return ret;
} }
+3 -1
View File
@@ -2337,7 +2337,9 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
struct dhcp_netid *tt = opt_malloc(sizeof (struct dhcp_netid)); struct dhcp_netid *tt = opt_malloc(sizeof (struct dhcp_netid));
tt->net = opt_string_alloc(arg+4); tt->net = opt_string_alloc(arg+4);
tt->next = new->filter; tt->next = new->filter;
new->filter = tt; /* ignore empty tag */
if (tt->net)
new->filter = tt;
} }
else else
{ {