mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
import of dnsmasq-2.2.tar.gz
This commit is contained in:
@@ -12,14 +12,13 @@
|
||||
|
||||
/* Author's email: simon@thekelleys.org.uk */
|
||||
|
||||
#define VERSION "2.1"
|
||||
#define VERSION "2.2"
|
||||
|
||||
#define FTABSIZ 150 /* max number of outstanding requests */
|
||||
#define TIMEOUT 40 /* drop queries after TIMEOUT seconds */
|
||||
#define LOGRATE 120 /* log table overflows every LOGRATE seconds */
|
||||
#define CACHESIZ 150 /* default cache size */
|
||||
#define SMALLDNAME 40 /* most domain names are smaller than this */
|
||||
#define CONFFILE "/etc/dnsmasq.conf"
|
||||
#define HOSTSFILE "/etc/hosts"
|
||||
#ifdef __uClinux__
|
||||
# define RESOLVFILE "/etc/config/resolv.conf"
|
||||
@@ -29,8 +28,10 @@
|
||||
#define RUNFILE "/var/run/dnsmasq.pid"
|
||||
#ifdef __FreeBSD__
|
||||
# define LEASEFILE "/var/db/dnsmasq.leases"
|
||||
# define CONFFILE "/usr/local/etc/dnsmasq.conf"
|
||||
#else
|
||||
# define LEASEFILE "/var/lib/misc/dnsmasq.leases"
|
||||
# define CONFFILE "/etc/dnsmasq.conf"
|
||||
#endif
|
||||
#define DEFLEASE 3600 /* default lease time, 1 hour */
|
||||
#define CHUSER "nobody"
|
||||
|
||||
@@ -218,7 +218,8 @@ char *enumerate_interfaces(struct irec **interfacep,
|
||||
{
|
||||
FILE *f = fopen(IP6INTERFACES, "r");
|
||||
int found = 0;
|
||||
|
||||
union mysockaddr addr6;
|
||||
|
||||
if (f)
|
||||
{
|
||||
unsigned int plen, scope, flags, if_idx;
|
||||
@@ -230,18 +231,18 @@ char *enumerate_interfaces(struct irec **interfacep,
|
||||
if (strcmp(devname, ifr->ifr_name) == 0)
|
||||
{
|
||||
int i;
|
||||
unsigned char *addr6p = (unsigned char *) &addr.in6.sin6_addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sa.sa_family = AF_INET6;
|
||||
unsigned char *addr6p = (unsigned char *) &addr6.in6.sin6_addr;
|
||||
memset(&addr6, 0, sizeof(addr6));
|
||||
addr6.sa.sa_family = AF_INET6;
|
||||
for (i=0; i<16; i++)
|
||||
{
|
||||
unsigned int byte;
|
||||
sscanf(addrstring+i+i, "%02x", &byte);
|
||||
addr6p[i] = byte;
|
||||
}
|
||||
addr.in6.sin6_port = htons(port);
|
||||
addr.in6.sin6_flowinfo = htonl(0);
|
||||
addr.in6.sin6_scope_id = htonl(scope);
|
||||
addr6.in6.sin6_port = htons(port);
|
||||
addr6.in6.sin6_flowinfo = htonl(0);
|
||||
addr6.in6.sin6_scope_id = htonl(scope);
|
||||
|
||||
found = 1;
|
||||
break;
|
||||
@@ -253,7 +254,7 @@ char *enumerate_interfaces(struct irec **interfacep,
|
||||
|
||||
if (found &&
|
||||
(err = add_iface(interfacep, ifr->ifr_flags, ifr->ifr_name,
|
||||
&addr, names, addrs, except)))
|
||||
&addr6, names, addrs, except)))
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user