mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-06 15:51:41 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec8f3e65c1 | ||
|
|
15841f187d | ||
|
|
ade97495e6 | ||
|
|
2b19285724 | ||
|
|
a444715bf0 | ||
|
|
14e81b6976 | ||
|
|
6ce7f2d55a |
No files matched your search
+4
-2
@@ -2360,6 +2360,8 @@ void log_query(unsigned int flags, char *name, union all_addr *addr, char *arg,
|
|||||||
source = "reply";
|
source = "reply";
|
||||||
else if (flags & F_AUTH)
|
else if (flags & F_AUTH)
|
||||||
source = "auth";
|
source = "auth";
|
||||||
|
else if (flags & F_QUERY)
|
||||||
|
source = "query";
|
||||||
else if (flags & F_SECSTAT)
|
else if (flags & F_SECSTAT)
|
||||||
{
|
{
|
||||||
if (addr && addr->log.ede != EDE_UNSET && option_bool(OPT_EXTRALOG))
|
if (addr && addr->log.ede != EDE_UNSET && option_bool(OPT_EXTRALOG))
|
||||||
@@ -2400,8 +2402,8 @@ void log_query(unsigned int flags, char *name, union all_addr *addr, char *arg,
|
|||||||
source = "non-query opcode";
|
source = "non-query opcode";
|
||||||
name = opcodestring;
|
name = opcodestring;
|
||||||
}
|
}
|
||||||
else if (!(flags & F_AUTH))
|
else if (type > 0)
|
||||||
source = "query";
|
source = querystr(source, type);
|
||||||
|
|
||||||
verb = "from";
|
verb = "from";
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -349,7 +349,6 @@ HAVE_SOCKADDR_SA_LEN
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_LINUX_NETWORK)
|
#if !defined(HAVE_LINUX_NETWORK)
|
||||||
#undef HAVE_IPSET
|
|
||||||
#undef HAVE_NFTSET
|
#undef HAVE_NFTSET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -357,6 +356,16 @@ HAVE_SOCKADDR_SA_LEN
|
|||||||
#undef HAVE_IPSET
|
#undef HAVE_IPSET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_IPSET)
|
||||||
|
# if defined(HAVE_LINUX_NETWORK)
|
||||||
|
# define HAVE_LINUX_IPSET
|
||||||
|
# elif defined(HAVE_BSD_NETWORK)
|
||||||
|
# define HAVE_BSD_IPSET
|
||||||
|
# else
|
||||||
|
# undef HAVE_IPSET
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NO_LOOP
|
#ifdef NO_LOOP
|
||||||
#undef HAVE_LOOP
|
#undef HAVE_LOOP
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+6
-2
@@ -244,7 +244,10 @@ int lookup_domain(char *domain, int flags, int *lowout, int *highout)
|
|||||||
if (nodots &&
|
if (nodots &&
|
||||||
(daemon->serverarray[daemon->serverarraysz-1]->flags & SERV_FOR_NODOTS) &&
|
(daemon->serverarray[daemon->serverarraysz-1]->flags & SERV_FOR_NODOTS) &&
|
||||||
(nlow == nhigh || daemon->serverarray[nlow]->domain_len == 0))
|
(nlow == nhigh || daemon->serverarray[nlow]->domain_len == 0))
|
||||||
filter_servers(daemon->serverarraysz-1, flags, &nlow, &nhigh);
|
{
|
||||||
|
filter_servers(daemon->serverarraysz-1, flags, &nlow, &nhigh);
|
||||||
|
qlen = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (lowout)
|
if (lowout)
|
||||||
*lowout = nlow;
|
*lowout = nlow;
|
||||||
@@ -343,7 +346,8 @@ int filter_servers(int seed, int flags, int *lowout, int *highout)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If we want a server for a particular domain, and this one isn't, return nothing. */
|
/* If we want a server for a particular domain, and this one isn't, return nothing. */
|
||||||
if (nlow != nhigh && (flags & F_DOMAINSRV) && daemon->serverarray[nlow]->domain_len == 0)
|
if (nlow < daemon->serverarraysz && nlow != nhigh && (flags & F_DOMAINSRV) &&
|
||||||
|
daemon->serverarray[nlow]->domain_len == 0 && !(daemon->serverarray[nlow]->flags & SERV_FOR_NODOTS))
|
||||||
nlow = nhigh;
|
nlow = nhigh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "dnsmasq.h"
|
#include "dnsmasq.h"
|
||||||
|
|
||||||
#if defined(HAVE_IPSET)
|
#if defined(HAVE_LINUX_IPSET)
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
+7
-3
@@ -2917,13 +2917,17 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
#pragma GCC diagnostic push
|
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
||||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||||
|
# endif
|
||||||
case LOPT_LEASEQUERY:
|
case LOPT_LEASEQUERY:
|
||||||
set_option_bool(OPT_LEASEQUERY);
|
set_option_bool(OPT_LEASEQUERY);
|
||||||
if (!arg)
|
if (!arg)
|
||||||
break;
|
break;
|
||||||
#pragma GCC diagnostic pop
|
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
case 'B': /* --bogus-nxdomain */
|
case 'B': /* --bogus-nxdomain */
|
||||||
case LOPT_IGNORE_ADDR: /* --ignore-address */
|
case LOPT_IGNORE_ADDR: /* --ignore-address */
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include "dnsmasq.h"
|
#include "dnsmasq.h"
|
||||||
|
|
||||||
#if defined(HAVE_IPSET) && defined(HAVE_BSD_NETWORK)
|
#if defined(HAVE_BSD_IPSET)
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
+33
-4
@@ -34,6 +34,10 @@
|
|||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_BSD_NETWORK
|
||||||
|
#include <libgen.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* SURF random number generator */
|
/* SURF random number generator */
|
||||||
|
|
||||||
static u32 seed[32];
|
static u32 seed[32];
|
||||||
@@ -831,9 +835,34 @@ void close_fds(long max_fd, int spare1, int spare2, int spare3)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FDESCFS
|
#ifdef FDESCFS
|
||||||
DIR *d;
|
DIR *d = NULL;
|
||||||
|
|
||||||
if ((d = opendir(FDESCFS)))
|
# ifdef HAVE_BSD_NETWORK
|
||||||
|
dev_t dirdev = 0;
|
||||||
|
char fdescfs[] = FDESCFS; /* string must be writable */
|
||||||
|
struct stat statbuf;
|
||||||
|
|
||||||
|
/* On BSD, fdescfs is normally mounted at /dev/fd. However
|
||||||
|
if it is NOT mounted, devfs creates a directory at /dev/fd
|
||||||
|
which contains (only) the file descriptors 0,1 and 2.
|
||||||
|
|
||||||
|
Under these conditions, opendir() will succeed, and
|
||||||
|
if we proceed we will fail to close extant
|
||||||
|
file descriptors which should be closed.
|
||||||
|
|
||||||
|
Check that there is a filesystem mounted at /dev/fd
|
||||||
|
by checking that the device changes between /dev/fd
|
||||||
|
and /dev. If if doesn't, fall back to the dumb path. */
|
||||||
|
|
||||||
|
if (stat(fdescfs, &statbuf) != -1)
|
||||||
|
dirdev = statbuf.st_dev;
|
||||||
|
|
||||||
|
if (stat(dirname(fdescfs), &statbuf) != -1 &&
|
||||||
|
dirdev != statbuf.st_dev)
|
||||||
|
# endif
|
||||||
|
d = opendir(FDESCFS);
|
||||||
|
|
||||||
|
if (d)
|
||||||
{
|
{
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
|
|
||||||
@@ -855,9 +884,9 @@ void close_fds(long max_fd, int spare1, int spare2, int spare3)
|
|||||||
|
|
||||||
closedir(d);
|
closedir(d);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* fallback, dumb code. */
|
/* fallback, dumb code. */
|
||||||
for (max_fd--; max_fd >= 0; max_fd--)
|
for (max_fd--; max_fd >= 0; max_fd--)
|
||||||
if (max_fd != STDOUT_FILENO && max_fd != STDERR_FILENO && max_fd != STDIN_FILENO &&
|
if (max_fd != STDOUT_FILENO && max_fd != STDERR_FILENO && max_fd != STDIN_FILENO &&
|
||||||
|
|||||||
Reference in new issue
Block a user