mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-06 15:51:41 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
254390644a | ||
|
|
241fa9c6c8 | ||
|
|
e142a83296 |
No files matched your search
@@ -33,6 +33,12 @@ version 2.68
|
|||||||
get advertised with zero preferred time. Thanks to Tsachi
|
get advertised with zero preferred time. Thanks to Tsachi
|
||||||
for the bug report.
|
for the bug report.
|
||||||
|
|
||||||
|
Fix segfault with some locally configured CNAMEs. Thanks
|
||||||
|
to Andrew Childs for spotting the problem.
|
||||||
|
|
||||||
|
Fix memory leak on re-reading /etc/hosts and friends,
|
||||||
|
introduced in 2.67.
|
||||||
|
|
||||||
|
|
||||||
version 2.67
|
version 2.67
|
||||||
Fix crash if upstream server returns SERVFAIL when
|
Fix crash if upstream server returns SERVFAIL when
|
||||||
|
|||||||
+422
-374
File diff suppressed because it is too large.
Load diff
+10
-10
@@ -320,7 +320,7 @@ static int cache_scan_free(char *name, struct all_addr *addr, time_t now, unsign
|
|||||||
if (is_expired(now, crecp) || is_outdated_cname_pointer(crecp))
|
if (is_expired(now, crecp) || is_outdated_cname_pointer(crecp))
|
||||||
{
|
{
|
||||||
*up = crecp->hash_next;
|
*up = crecp->hash_next;
|
||||||
if (!(crecp->flags & (F_HOSTS | F_DHCP)))
|
if (!(crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)))
|
||||||
{
|
{
|
||||||
cache_unlink(crecp);
|
cache_unlink(crecp);
|
||||||
cache_free(crecp);
|
cache_free(crecp);
|
||||||
@@ -354,13 +354,13 @@ static int cache_scan_free(char *name, struct all_addr *addr, time_t now, unsign
|
|||||||
if (is_expired(now, crecp))
|
if (is_expired(now, crecp))
|
||||||
{
|
{
|
||||||
*up = crecp->hash_next;
|
*up = crecp->hash_next;
|
||||||
if (!(crecp->flags & (F_HOSTS | F_DHCP)))
|
if (!(crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)))
|
||||||
{
|
{
|
||||||
cache_unlink(crecp);
|
cache_unlink(crecp);
|
||||||
cache_free(crecp);
|
cache_free(crecp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!(crecp->flags & (F_HOSTS | F_DHCP)) &&
|
else if (!(crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)) &&
|
||||||
(flags & crecp->flags & F_REVERSE) &&
|
(flags & crecp->flags & F_REVERSE) &&
|
||||||
(flags & crecp->flags & (F_IPV4 | F_IPV6)) &&
|
(flags & crecp->flags & (F_IPV4 | F_IPV6)) &&
|
||||||
memcmp(&crecp->addr.addr, addr, addrlen) == 0)
|
memcmp(&crecp->addr.addr, addr, addrlen) == 0)
|
||||||
@@ -558,7 +558,7 @@ struct crec *cache_find_by_name(struct crec *crecp, char *name, time_t now, unsi
|
|||||||
(crecp->flags & prot) &&
|
(crecp->flags & prot) &&
|
||||||
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 | F_CONFIG))
|
||||||
{
|
{
|
||||||
*chainp = crecp;
|
*chainp = crecp;
|
||||||
chainp = &crecp->next;
|
chainp = &crecp->next;
|
||||||
@@ -599,7 +599,7 @@ struct crec *cache_find_by_name(struct crec *crecp, char *name, time_t now, unsi
|
|||||||
{
|
{
|
||||||
/* expired entry, free it */
|
/* expired entry, free it */
|
||||||
*up = crecp->hash_next;
|
*up = crecp->hash_next;
|
||||||
if (!(crecp->flags & (F_HOSTS | F_DHCP)))
|
if (!(crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)))
|
||||||
{
|
{
|
||||||
cache_unlink(crecp);
|
cache_unlink(crecp);
|
||||||
cache_free(crecp);
|
cache_free(crecp);
|
||||||
@@ -649,7 +649,7 @@ struct crec *cache_find_by_addr(struct crec *crecp, struct all_addr *addr,
|
|||||||
if ((crecp->flags & prot) &&
|
if ((crecp->flags & prot) &&
|
||||||
memcmp(&crecp->addr.addr, addr, addrlen) == 0)
|
memcmp(&crecp->addr.addr, addr, addrlen) == 0)
|
||||||
{
|
{
|
||||||
if (crecp->flags & (F_HOSTS | F_DHCP))
|
if (crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG))
|
||||||
{
|
{
|
||||||
*chainp = crecp;
|
*chainp = crecp;
|
||||||
chainp = &crecp->next;
|
chainp = &crecp->next;
|
||||||
@@ -665,7 +665,7 @@ struct crec *cache_find_by_addr(struct crec *crecp, struct all_addr *addr,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
*up = crecp->hash_next;
|
*up = crecp->hash_next;
|
||||||
if (!(crecp->flags & (F_HOSTS | F_DHCP)))
|
if (!(crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)))
|
||||||
{
|
{
|
||||||
cache_unlink(crecp);
|
cache_unlink(crecp);
|
||||||
cache_free(crecp);
|
cache_free(crecp);
|
||||||
@@ -923,7 +923,7 @@ void cache_reload(void)
|
|||||||
for (cache = hash_table[i], up = &hash_table[i]; cache; cache = tmp)
|
for (cache = hash_table[i], up = &hash_table[i]; cache; cache = tmp)
|
||||||
{
|
{
|
||||||
tmp = cache->hash_next;
|
tmp = cache->hash_next;
|
||||||
if (cache->flags & F_HOSTS)
|
if (cache->flags & (F_HOSTS | F_CONFIG))
|
||||||
{
|
{
|
||||||
*up = cache->hash_next;
|
*up = cache->hash_next;
|
||||||
free(cache);
|
free(cache);
|
||||||
@@ -947,7 +947,7 @@ void cache_reload(void)
|
|||||||
for (intr = daemon->int_names; intr; intr = intr->next)
|
for (intr = daemon->int_names; intr; intr = intr->next)
|
||||||
if (hostname_isequal(a->target, intr->name))
|
if (hostname_isequal(a->target, intr->name))
|
||||||
{
|
{
|
||||||
struct crec *aliasc = safe_malloc(sizeof(struct crec));
|
struct crec *aliasc = whine_malloc(sizeof(struct crec));
|
||||||
aliasc->flags = F_FORWARD | F_NAMEP | F_CNAME | F_IMMORTAL | F_CONFIG;
|
aliasc->flags = F_FORWARD | F_NAMEP | F_CNAME | F_IMMORTAL | F_CONFIG;
|
||||||
aliasc->name.namep = a->alias;
|
aliasc->name.namep = a->alias;
|
||||||
aliasc->addr.cname.target.int_name = intr;
|
aliasc->addr.cname.target.int_name = intr;
|
||||||
@@ -1083,7 +1083,7 @@ void cache_add_dhcp_entry(char *host_name, int prot,
|
|||||||
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 | F_CONFIG))
|
||||||
{
|
{
|
||||||
if (crec->flags & F_CNAME)
|
if (crec->flags & F_CNAME)
|
||||||
my_syslog(MS_DHCP | LOG_WARNING,
|
my_syslog(MS_DHCP | LOG_WARNING,
|
||||||
|
|||||||
@@ -189,10 +189,6 @@ HAVE_SOLARIS_NETWORK
|
|||||||
HAVE_GETOPT_LONG
|
HAVE_GETOPT_LONG
|
||||||
defined when GNU-style getopt_long available.
|
defined when GNU-style getopt_long available.
|
||||||
|
|
||||||
HAVE_ARC4RANDOM
|
|
||||||
defined if arc4random() available to get better security from DNS spoofs
|
|
||||||
by using really random ids (OpenBSD)
|
|
||||||
|
|
||||||
HAVE_SOCKADDR_SA_LEN
|
HAVE_SOCKADDR_SA_LEN
|
||||||
defined if struct sockaddr has sa_len field (*BSD)
|
defined if struct sockaddr has sa_len field (*BSD)
|
||||||
*/
|
*/
|
||||||
@@ -201,7 +197,6 @@ HAVE_SOCKADDR_SA_LEN
|
|||||||
#if defined(__uClinux__)
|
#if defined(__uClinux__)
|
||||||
#define HAVE_LINUX_NETWORK
|
#define HAVE_LINUX_NETWORK
|
||||||
#define HAVE_GETOPT_LONG
|
#define HAVE_GETOPT_LONG
|
||||||
#undef HAVE_ARC4RANDOM
|
|
||||||
#undef HAVE_SOCKADDR_SA_LEN
|
#undef HAVE_SOCKADDR_SA_LEN
|
||||||
/* Never use fork() on uClinux. Note that this is subtly different from the
|
/* Never use fork() on uClinux. Note that this is subtly different from the
|
||||||
--keep-in-foreground option, since it also suppresses forking new
|
--keep-in-foreground option, since it also suppresses forking new
|
||||||
@@ -215,7 +210,6 @@ HAVE_SOCKADDR_SA_LEN
|
|||||||
((__UCLIBC_MAJOR__==0) && (__UCLIBC_MINOR__==9) && (__UCLIBC_SUBLEVEL__<21))
|
((__UCLIBC_MAJOR__==0) && (__UCLIBC_MINOR__==9) && (__UCLIBC_SUBLEVEL__<21))
|
||||||
# define HAVE_GETOPT_LONG
|
# define HAVE_GETOPT_LONG
|
||||||
#endif
|
#endif
|
||||||
#undef HAVE_ARC4RANDOM
|
|
||||||
#undef HAVE_SOCKADDR_SA_LEN
|
#undef HAVE_SOCKADDR_SA_LEN
|
||||||
#if !defined(__ARCH_HAS_MMU__) && !defined(__UCLIBC_HAS_MMU__)
|
#if !defined(__ARCH_HAS_MMU__) && !defined(__UCLIBC_HAS_MMU__)
|
||||||
# define NO_FORK
|
# define NO_FORK
|
||||||
@@ -230,7 +224,6 @@ HAVE_SOCKADDR_SA_LEN
|
|||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
#define HAVE_LINUX_NETWORK
|
#define HAVE_LINUX_NETWORK
|
||||||
#define HAVE_GETOPT_LONG
|
#define HAVE_GETOPT_LONG
|
||||||
#undef HAVE_ARC4RANDOM
|
|
||||||
#undef HAVE_SOCKADDR_SA_LEN
|
#undef HAVE_SOCKADDR_SA_LEN
|
||||||
|
|
||||||
#elif defined(__FreeBSD__) || \
|
#elif defined(__FreeBSD__) || \
|
||||||
@@ -242,15 +235,11 @@ HAVE_SOCKADDR_SA_LEN
|
|||||||
#if defined(optional_argument) && defined(required_argument)
|
#if defined(optional_argument) && defined(required_argument)
|
||||||
# define HAVE_GETOPT_LONG
|
# define HAVE_GETOPT_LONG
|
||||||
#endif
|
#endif
|
||||||
#if !defined(__FreeBSD_kernel__)
|
|
||||||
# define HAVE_ARC4RANDOM
|
|
||||||
#endif
|
|
||||||
#define HAVE_SOCKADDR_SA_LEN
|
#define HAVE_SOCKADDR_SA_LEN
|
||||||
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#define HAVE_BSD_NETWORK
|
#define HAVE_BSD_NETWORK
|
||||||
#define HAVE_GETOPT_LONG
|
#define HAVE_GETOPT_LONG
|
||||||
#define HAVE_ARC4RANDOM
|
|
||||||
#define HAVE_SOCKADDR_SA_LEN
|
#define HAVE_SOCKADDR_SA_LEN
|
||||||
/* Define before sys/socket.h is included so we get socklen_t */
|
/* Define before sys/socket.h is included so we get socklen_t */
|
||||||
#define _BSD_SOCKLEN_T_
|
#define _BSD_SOCKLEN_T_
|
||||||
@@ -261,13 +250,11 @@ HAVE_SOCKADDR_SA_LEN
|
|||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
#define HAVE_BSD_NETWORK
|
#define HAVE_BSD_NETWORK
|
||||||
#define HAVE_GETOPT_LONG
|
#define HAVE_GETOPT_LONG
|
||||||
#undef HAVE_ARC4RANDOM
|
|
||||||
#define HAVE_SOCKADDR_SA_LEN
|
#define HAVE_SOCKADDR_SA_LEN
|
||||||
|
|
||||||
#elif defined(__sun) || defined(__sun__)
|
#elif defined(__sun) || defined(__sun__)
|
||||||
#define HAVE_SOLARIS_NETWORK
|
#define HAVE_SOLARIS_NETWORK
|
||||||
#define HAVE_GETOPT_LONG
|
#define HAVE_GETOPT_LONG
|
||||||
#undef HAVE_ARC4RANDOM
|
|
||||||
#undef HAVE_SOCKADDR_SA_LEN
|
#undef HAVE_SOCKADDR_SA_LEN
|
||||||
#define ETHER_ADDR_LEN 6
|
#define ETHER_ADDR_LEN 6
|
||||||
|
|
||||||
|
|||||||
-24
@@ -28,28 +28,6 @@
|
|||||||
#include <idna.h>
|
#include <idna.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ARC4RANDOM
|
|
||||||
void rand_init(void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned short rand16(void)
|
|
||||||
{
|
|
||||||
return (unsigned short) (arc4random() >> 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
u64 rand64(void)
|
|
||||||
{
|
|
||||||
u64 ret;
|
|
||||||
|
|
||||||
arc4random_buf(&ret, sizeof(ret));
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* SURF random number generator */
|
/* SURF random number generator */
|
||||||
|
|
||||||
static u32 seed[32];
|
static u32 seed[32];
|
||||||
@@ -119,8 +97,6 @@ u64 rand64(void)
|
|||||||
return (u64)out[outleft+1] + (((u64)out[outleft]) << 32);
|
return (u64)out[outleft+1] + (((u64)out[outleft]) << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int check_name(char *in)
|
static int check_name(char *in)
|
||||||
{
|
{
|
||||||
/* remove trailing .
|
/* remove trailing .
|
||||||
|
|||||||
Reference in new issue
Block a user