mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-12 16:50:54 +00:00
Compare commits
13
Commits
v2.64test7
...
v2.65
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f6698643b | ||
|
|
c2e5c8d7cf | ||
|
|
95050a8d8b | ||
|
|
29d28dda95 | ||
|
|
421594f83d | ||
|
|
d89fb4ed4f | ||
|
|
295a54eed3 | ||
|
|
2f38141f43 | ||
|
|
8e4b87918f | ||
|
|
83b2198e86 | ||
|
|
d1a5975f9b | ||
|
|
52002051ad | ||
|
|
b191a77901 |
No files matched your search
@@ -1,3 +1,14 @@
|
|||||||
|
version 2.65
|
||||||
|
Fix regression which broke forwarding of queries sent via
|
||||||
|
TCP which are not for A and AAAA and which were directed to
|
||||||
|
non-default servers. Thanks to Niax for the bug report.
|
||||||
|
|
||||||
|
Fix failure to build with DHCP support excluded. Thanks to
|
||||||
|
Gustavo Zacarias for the patch.
|
||||||
|
|
||||||
|
Fix nasty regression in 2.64 which completely broke cacheing.
|
||||||
|
|
||||||
|
|
||||||
version 2.64
|
version 2.64
|
||||||
Handle DHCP FQDN options with all flag bits zero and
|
Handle DHCP FQDN options with all flag bits zero and
|
||||||
--dhcp-client-update set. Thanks to Bernd Krumbroeck for
|
--dhcp-client-update set. Thanks to Bernd Krumbroeck for
|
||||||
@@ -19,9 +30,12 @@ version 2.64
|
|||||||
Flag DHCP or DHCPv6 in starup logging. Thanks to
|
Flag DHCP or DHCPv6 in starup logging. Thanks to
|
||||||
Vladislav Grishenko for the patch.
|
Vladislav Grishenko for the patch.
|
||||||
|
|
||||||
Add SetServersEX method in DBus interface. Thanks to Dan
|
Add SetServersEx method in DBus interface. Thanks to Dan
|
||||||
Williams for the patch.
|
Williams for the patch.
|
||||||
|
|
||||||
|
Add SetDomainServers method in DBus interface. Thanks to
|
||||||
|
Roy Marples for the patch.
|
||||||
|
|
||||||
Fix build with later Lua libraries. Thansk to Cristian
|
Fix build with later Lua libraries. Thansk to Cristian
|
||||||
Rodriguez for the patch.
|
Rodriguez for the patch.
|
||||||
|
|
||||||
@@ -45,6 +59,26 @@ version 2.64
|
|||||||
subnet, --dhcp-range=::,static Useful for Stateless
|
subnet, --dhcp-range=::,static Useful for Stateless
|
||||||
DHCPv6. Thanks to Vladislav Grishenko for the patch.
|
DHCPv6. Thanks to Vladislav Grishenko for the patch.
|
||||||
|
|
||||||
|
Don't include lease-time in DHCPACK replies to DHCPINFORM
|
||||||
|
queries, since RFC-2131 says we shouldn't. Thanks to
|
||||||
|
Wouter Ibens for pointing this out.
|
||||||
|
|
||||||
|
Makefile tweak to do dependency checking on header files.
|
||||||
|
Thanks to Johan Peeters for the patch.
|
||||||
|
|
||||||
|
Check interface for outgoing unsolicited router
|
||||||
|
advertisements, rather than relying on interface address
|
||||||
|
configuration. Thanks to Gene Czarinski for the patch.
|
||||||
|
|
||||||
|
Handle better attempts to transmit on interfaces which are
|
||||||
|
still doing DAD, and specifically do not just transmit
|
||||||
|
without setting source address and interface, since this
|
||||||
|
can cause very puzzling effects when a router
|
||||||
|
advertisement goes astray. Thanks again to Gene Czarinski.
|
||||||
|
|
||||||
|
Get RA timers right when there is more than one
|
||||||
|
dhcp-range on a subnet.
|
||||||
|
|
||||||
|
|
||||||
version 2.63
|
version 2.63
|
||||||
Do duplicate dhcp-host address check in --test mode.
|
Do duplicate dhcp-host address check in --test mode.
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ all : $(BUILDDIR)
|
|||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f *~ $(BUILDDIR)/*.mo contrib/*/*~ */*~ $(BUILDDIR)/*.pot
|
rm -f *~ $(BUILDDIR)/*.mo contrib/*/*~ */*~ $(BUILDDIR)/*.pot
|
||||||
rm -f $(BUILDDIR)/*.o $(BUILDDIR)/dnsmasq.a $(BUILDDIR)/dnsmasq core */core
|
rm -f $(BUILDDIR)/.configured $(BUILDDIR)/*.o $(BUILDDIR)/dnsmasq.a $(BUILDDIR)/dnsmasq
|
||||||
|
rm -rf core */core
|
||||||
|
|
||||||
install : all install-common
|
install : all install-common
|
||||||
|
|
||||||
@@ -113,7 +114,11 @@ $(BUILDDIR):
|
|||||||
mkdir -p $(BUILDDIR)
|
mkdir -p $(BUILDDIR)
|
||||||
|
|
||||||
|
|
||||||
# rules below are targets in recusive makes with cwd=$(SRC)
|
# rules below are targets in recusive makes with cwd=$(BUILDDIR)
|
||||||
|
|
||||||
|
.configured: $(hdrs)
|
||||||
|
@rm -f *.o
|
||||||
|
@touch $@
|
||||||
|
|
||||||
$(objs:.o=.c) $(hdrs):
|
$(objs:.o=.c) $(hdrs):
|
||||||
ln -s $(top)/$(SRC)/$@ .
|
ln -s $(top)/$(SRC)/$@ .
|
||||||
@@ -121,7 +126,7 @@ $(objs:.o=.c) $(hdrs):
|
|||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<
|
$(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<
|
||||||
|
|
||||||
dnsmasq : $(hdrs) $(objs)
|
dnsmasq : .configured $(hdrs) $(objs)
|
||||||
$(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS)
|
$(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS)
|
||||||
|
|
||||||
dnsmasq.pot : $(objs:.o=.c) $(hdrs)
|
dnsmasq.pot : $(objs:.o=.c) $(hdrs)
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ elif grep '\$Format:%d\$' $1/VERSION >/dev/null 2>&1; then
|
|||||||
# unsubstituted VERSION, but no git available.
|
# unsubstituted VERSION, but no git available.
|
||||||
echo UNKNOWN
|
echo UNKNOWN
|
||||||
else
|
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}" | sort | head -n 1 | sed 's/^v//'
|
echo "${vers}" | sort | head -n 1 | sed 's/^v//'
|
||||||
|
|||||||
@@ -137,6 +137,23 @@ Each call to SetServersEx completely replaces the set of servers
|
|||||||
specified by via the DBus, but it leaves any servers specified via the
|
specified by via the DBus, but it leaves any servers specified via the
|
||||||
command line or /etc/dnsmasq.conf or /etc/resolv.conf alone.
|
command line or /etc/dnsmasq.conf or /etc/resolv.conf alone.
|
||||||
|
|
||||||
|
|
||||||
|
SetDomainServers
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Yes another variation for setting DNS servers, with the capability of
|
||||||
|
SetServersEx, but without using arrays of arrays, which are not
|
||||||
|
sendable with dbus-send. The arguments are an array of strings which
|
||||||
|
are identical to the equivalent arguments --server, so the example
|
||||||
|
for SetServersEx is represented as
|
||||||
|
|
||||||
|
[
|
||||||
|
"/foobar.com/1.2.3.4"
|
||||||
|
"/eng.mycorp.com/lab.mycorp.com/1003:1234:abcd::1%eth0"
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2. SIGNALS
|
2. SIGNALS
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
Vendored
+6
@@ -1,3 +1,9 @@
|
|||||||
|
dnsmasq (2.65-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream.
|
||||||
|
|
||||||
|
-- Simon Kelley <simon@thekelleys.org.uk> Fri, 14 Dec 2012 11:34:12 +0000
|
||||||
|
|
||||||
dnsmasq (2.64-1) unstable; urgency=low
|
dnsmasq (2.64-1) unstable; urgency=low
|
||||||
|
|
||||||
* New upstream.
|
* New upstream.
|
||||||
|
|||||||
+8
-2
@@ -83,7 +83,9 @@ or launchd.
|
|||||||
Debug mode: don't fork to the background, don't write a pid file,
|
Debug mode: don't fork to the background, don't write a pid file,
|
||||||
don't change user id, generate a complete cache dump on receipt on
|
don't change user id, generate a complete cache dump on receipt on
|
||||||
SIGUSR1, log to stderr as well as syslog, don't fork new processes
|
SIGUSR1, log to stderr as well as syslog, don't fork new processes
|
||||||
to handle TCP queries.
|
to handle TCP queries. Note that this option is for use in debugging
|
||||||
|
only, to stop dnsmasq daemonising in production, use
|
||||||
|
.B -k.
|
||||||
.TP
|
.TP
|
||||||
.B \-q, --log-queries
|
.B \-q, --log-queries
|
||||||
Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on receipt of SIGUSR1.
|
Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on receipt of SIGUSR1.
|
||||||
@@ -584,7 +586,11 @@ which tells dnsmasq to enable DHCP for the network specified, but not
|
|||||||
to dynamically allocate IP addresses: only hosts which have static
|
to dynamically allocate IP addresses: only hosts which have static
|
||||||
addresses given via
|
addresses given via
|
||||||
.B dhcp-host
|
.B dhcp-host
|
||||||
or from /etc/ethers will be served.
|
or from /etc/ethers will be served. A static-only subnet with address
|
||||||
|
all zeros may be used as a "catch-all" address to enable replies to all
|
||||||
|
Information-request packets on a subnet which is provided with
|
||||||
|
stateless DHCPv6, ie
|
||||||
|
.B --dhcp=range=::,static
|
||||||
|
|
||||||
For IPv4, the <mode> may be
|
For IPv4, the <mode> may be
|
||||||
.B proxy
|
.B proxy
|
||||||
|
|||||||
+1
-1
@@ -371,7 +371,7 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
|
|||||||
int freed_all = flags & F_REVERSE;
|
int freed_all = flags & F_REVERSE;
|
||||||
int free_avail = 0;
|
int free_avail = 0;
|
||||||
|
|
||||||
if(daemon->max_cache_ttl < ttl)
|
if (daemon->max_cache_ttl != 0 && daemon->max_cache_ttl < ttl)
|
||||||
ttl = daemon->max_cache_ttl;
|
ttl = daemon->max_cache_ttl;
|
||||||
|
|
||||||
/* Don't log keys */
|
/* Don't log keys */
|
||||||
|
|||||||
+88
-16
@@ -38,6 +38,9 @@ const char* introspection_xml_template =
|
|||||||
" <method name=\"SetServers\">\n"
|
" <method name=\"SetServers\">\n"
|
||||||
" <arg name=\"servers\" direction=\"in\" type=\"av\"/>\n"
|
" <arg name=\"servers\" direction=\"in\" type=\"av\"/>\n"
|
||||||
" </method>\n"
|
" </method>\n"
|
||||||
|
" <method name=\"SetDomainServers\">\n"
|
||||||
|
" <arg name=\"servers\" direction=\"in\" type=\"as\"/>\n"
|
||||||
|
" </method>\n"
|
||||||
" <method name=\"SetServersEx\">\n"
|
" <method name=\"SetServersEx\">\n"
|
||||||
" <arg name=\"servers\" direction=\"in\" type=\"aas\"/>\n"
|
" <arg name=\"servers\" direction=\"in\" type=\"aas\"/>\n"
|
||||||
" </method>\n"
|
" </method>\n"
|
||||||
@@ -292,11 +295,14 @@ static void dbus_read_servers(DBusMessage *message)
|
|||||||
cleanup_dbus();
|
cleanup_dbus();
|
||||||
}
|
}
|
||||||
|
|
||||||
static DBusMessage* dbus_read_servers_ex(DBusMessage *message)
|
static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
|
||||||
{
|
{
|
||||||
DBusMessageIter iter, array_iter, string_iter;
|
DBusMessageIter iter, array_iter, string_iter;
|
||||||
DBusMessage *error = NULL;
|
DBusMessage *error = NULL;
|
||||||
const char *addr_err;
|
const char *addr_err;
|
||||||
|
char *dup = NULL;
|
||||||
|
|
||||||
|
my_syslog(LOG_INFO, _("setting upstream servers from DBus"));
|
||||||
|
|
||||||
if (!dbus_message_iter_init(message, &iter))
|
if (!dbus_message_iter_init(message, &iter))
|
||||||
{
|
{
|
||||||
@@ -306,10 +312,10 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message)
|
|||||||
|
|
||||||
/* check that the message contains an array of arrays */
|
/* check that the message contains an array of arrays */
|
||||||
if ((dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) ||
|
if ((dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) ||
|
||||||
(dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_ARRAY))
|
(dbus_message_iter_get_element_type(&iter) != (strings ? DBUS_TYPE_STRING : DBUS_TYPE_ARRAY)))
|
||||||
{
|
{
|
||||||
return dbus_message_new_error(message, DBUS_ERROR_INVALID_ARGS,
|
return dbus_message_new_error(message, DBUS_ERROR_INVALID_ARGS,
|
||||||
"Expected array of string arrays");
|
strings ? "Expected array of string" : "Expected array of string arrays");
|
||||||
}
|
}
|
||||||
|
|
||||||
mark_dbus();
|
mark_dbus();
|
||||||
@@ -321,8 +327,51 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message)
|
|||||||
const char *str = NULL;
|
const char *str = NULL;
|
||||||
union mysockaddr addr, source_addr;
|
union mysockaddr addr, source_addr;
|
||||||
char interface[IF_NAMESIZE];
|
char interface[IF_NAMESIZE];
|
||||||
char *str_addr;
|
char *str_addr, *str_domain = NULL;
|
||||||
|
|
||||||
|
if (strings)
|
||||||
|
{
|
||||||
|
dbus_message_iter_get_basic(&array_iter, &str);
|
||||||
|
if (!str || !strlen (str))
|
||||||
|
{
|
||||||
|
error = dbus_message_new_error(message, DBUS_ERROR_INVALID_ARGS,
|
||||||
|
"Empty string");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* dup the string because it gets modified during parsing */
|
||||||
|
if (!(dup = str_domain = whine_malloc(strlen(str)+1)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
strcpy(str_domain, str);
|
||||||
|
|
||||||
|
/* point to address part of old string for error message */
|
||||||
|
if ((str_addr = strrchr(str, '/')))
|
||||||
|
str = str_addr+1;
|
||||||
|
|
||||||
|
if ((str_addr = strrchr(str_domain, '/')))
|
||||||
|
{
|
||||||
|
if (*str_domain != '/' || str_addr == str_domain)
|
||||||
|
{
|
||||||
|
error = dbus_message_new_error_printf(message,
|
||||||
|
DBUS_ERROR_INVALID_ARGS,
|
||||||
|
"No domain terminator '%s'",
|
||||||
|
str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*str_addr++ = 0;
|
||||||
|
str_domain++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str_addr = str_domain;
|
||||||
|
str_domain = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* check the types of the struct and its elements */
|
/* check the types of the struct and its elements */
|
||||||
if ((dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_ARRAY) ||
|
if ((dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_ARRAY) ||
|
||||||
(dbus_message_iter_get_element_type(&array_iter) != DBUS_TYPE_STRING))
|
(dbus_message_iter_get_element_type(&array_iter) != DBUS_TYPE_STRING))
|
||||||
@@ -350,22 +399,19 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* dup the string because it gets modified during parsing */
|
||||||
|
if (!(dup = str_addr = whine_malloc(strlen(str)+1)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
strcpy(str_addr, str);
|
||||||
|
}
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
memset(&source_addr, 0, sizeof(source_addr));
|
memset(&source_addr, 0, sizeof(source_addr));
|
||||||
memset(&interface, 0, sizeof(interface));
|
memset(&interface, 0, sizeof(interface));
|
||||||
|
|
||||||
/* dup the string because it gets modified during parsing */
|
|
||||||
str_addr = strdup(str);
|
|
||||||
if (!str_addr)
|
|
||||||
{
|
|
||||||
error = dbus_message_new_error(message, DBUS_ERROR_INVALID_ARGS,
|
|
||||||
"Out of memory parsing IP address");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* parse the IP address */
|
/* parse the IP address */
|
||||||
addr_err = parse_server(str_addr, &addr, &source_addr, (char *) &interface, NULL);
|
addr_err = parse_server(str_addr, &addr, &source_addr, (char *) &interface, NULL);
|
||||||
free(str_addr);
|
|
||||||
|
|
||||||
if (addr_err)
|
if (addr_err)
|
||||||
{
|
{
|
||||||
@@ -375,6 +421,24 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strings)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (str_domain)
|
||||||
|
{
|
||||||
|
if ((p = strchr(str_domain, '/')))
|
||||||
|
*p++ = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
p = NULL;
|
||||||
|
|
||||||
|
add_update_server(&addr, &source_addr, interface, str_domain);
|
||||||
|
} while ((str_domain = p));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* jump past the address to the domain list (if any) */
|
/* jump past the address to the domain list (if any) */
|
||||||
dbus_message_iter_next (&string_iter);
|
dbus_message_iter_next (&string_iter);
|
||||||
|
|
||||||
@@ -387,6 +451,7 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message)
|
|||||||
|
|
||||||
add_update_server(&addr, &source_addr, interface, str);
|
add_update_server(&addr, &source_addr, interface, str);
|
||||||
} while (dbus_message_iter_get_arg_type(&string_iter) == DBUS_TYPE_STRING);
|
} while (dbus_message_iter_get_arg_type(&string_iter) == DBUS_TYPE_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
/* jump to next element in outer array */
|
/* jump to next element in outer array */
|
||||||
dbus_message_iter_next(&array_iter);
|
dbus_message_iter_next(&array_iter);
|
||||||
@@ -394,6 +459,9 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message)
|
|||||||
|
|
||||||
cleanup_dbus();
|
cleanup_dbus();
|
||||||
|
|
||||||
|
if (dup)
|
||||||
|
free(dup);
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,8 +500,12 @@ DBusHandlerResult message_handler(DBusConnection *connection,
|
|||||||
}
|
}
|
||||||
else if (strcmp(method, "SetServersEx") == 0)
|
else if (strcmp(method, "SetServersEx") == 0)
|
||||||
{
|
{
|
||||||
my_syslog(LOG_INFO, _("setting upstream servers from DBus"));
|
reply = dbus_read_servers_ex(message, 0);
|
||||||
reply = dbus_read_servers_ex(message);
|
check_servers();
|
||||||
|
}
|
||||||
|
else if (strcmp(method, "SetDomainServers") == 0)
|
||||||
|
{
|
||||||
|
reply = dbus_read_servers_ex(message, 1);
|
||||||
check_servers();
|
check_servers();
|
||||||
}
|
}
|
||||||
else if (strcmp(method, "ClearCache") == 0)
|
else if (strcmp(method, "ClearCache") == 0)
|
||||||
|
|||||||
+8
-14
@@ -95,23 +95,16 @@ int send_from(int fd, int nowild, char *packet, size_t len,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
retry:
|
while (sendmsg(fd, &msg, 0) == -1)
|
||||||
if (sendmsg(fd, &msg, 0) == -1)
|
|
||||||
{
|
{
|
||||||
/* certain Linux kernels seem to object to setting the source address in the IPv6 stack
|
|
||||||
by returning EINVAL from sendmsg. In that case, try again without setting the
|
|
||||||
source address, since it will nearly alway be correct anyway. IPv6 stinks. */
|
|
||||||
if (errno == EINVAL && msg.msg_controllen)
|
|
||||||
{
|
|
||||||
msg.msg_controllen = 0;
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (retry_send())
|
if (retry_send())
|
||||||
goto retry;
|
continue;
|
||||||
|
|
||||||
|
/* If interface is still in DAD, EINVAL results - ignore that. */
|
||||||
|
if (errno == EINVAL)
|
||||||
|
break;
|
||||||
|
|
||||||
my_syslog(LOG_ERR, _("failed to send packet: %s"), strerror(errno));
|
my_syslog(LOG_ERR, _("failed to send packet: %s"), strerror(errno));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -841,7 +834,8 @@ unsigned char *tcp_request(int confd, time_t now,
|
|||||||
int norebind = 0;
|
int norebind = 0;
|
||||||
int checking_disabled;
|
int checking_disabled;
|
||||||
size_t m;
|
size_t m;
|
||||||
unsigned short qtype, gotname;
|
unsigned short qtype;
|
||||||
|
unsigned int gotname;
|
||||||
unsigned char c1, c2;
|
unsigned char c1, c2;
|
||||||
/* Max TCP packet + slop */
|
/* Max TCP packet + slop */
|
||||||
unsigned char *packet = whine_malloc(65536 + MAXDNAME + RRFIXEDSZ);
|
unsigned char *packet = whine_malloc(65536 + MAXDNAME + RRFIXEDSZ);
|
||||||
|
|||||||
+2
-2
@@ -371,9 +371,9 @@ static int nl_async(struct nlmsghdr *h)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_DHCP6
|
|
||||||
else if (h->nlmsg_type == RTM_NEWADDR)
|
else if (h->nlmsg_type == RTM_NEWADDR)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_DHCP6
|
||||||
/* force RAs to sync new network and pick up new interfaces. */
|
/* force RAs to sync new network and pick up new interfaces. */
|
||||||
if (daemon->ra_contexts)
|
if (daemon->ra_contexts)
|
||||||
{
|
{
|
||||||
@@ -383,9 +383,9 @@ static int nl_async(struct nlmsghdr *h)
|
|||||||
iface_enumerate and can't re-enter it now */
|
iface_enumerate and can't re-enter it now */
|
||||||
send_alarm(0, 0);
|
send_alarm(0, 0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 1; /* clever bind mode - rescan */
|
return 1; /* clever bind mode - rescan */
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -623,6 +623,8 @@ static char *set_prefix(char *arg)
|
|||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
char *parse_server(char *arg, union mysockaddr *addr, union mysockaddr *source_addr, char *interface, int *flags)
|
char *parse_server(char *arg, union mysockaddr *addr, union mysockaddr *source_addr, char *interface, int *flags)
|
||||||
{
|
{
|
||||||
int source_port = 0, serv_port = NAMESERVER_PORT;
|
int source_port = 0, serv_port = NAMESERVER_PORT;
|
||||||
@@ -710,6 +712,7 @@ char *parse_server(char *arg, union mysockaddr *addr, union mysockaddr *source_a
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_DHCP
|
||||||
/* This is too insanely large to keep in-line in the switch */
|
/* This is too insanely large to keep in-line in the switch */
|
||||||
static int parse_dhcp_opt(char *errstr, char *arg, int flags)
|
static int parse_dhcp_opt(char *errstr, char *arg, int flags)
|
||||||
{
|
{
|
||||||
|
|||||||
+23
-4
@@ -457,6 +457,7 @@ time_t periodic_ra(time_t now)
|
|||||||
char interface[IF_NAMESIZE+1];
|
char interface[IF_NAMESIZE+1];
|
||||||
|
|
||||||
param.now = now;
|
param.now = now;
|
||||||
|
param.iface = 0;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -482,10 +483,18 @@ time_t periodic_ra(time_t now)
|
|||||||
ever be able to send ra's and satistfy it. */
|
ever be able to send ra's and satistfy it. */
|
||||||
if (iface_enumerate(AF_INET6, ¶m, iface_search))
|
if (iface_enumerate(AF_INET6, ¶m, iface_search))
|
||||||
context->ra_time = 0;
|
context->ra_time = 0;
|
||||||
else if (indextoname(daemon->icmp6fd, param.iface, interface))
|
else if (param.iface != 0 &&
|
||||||
|
indextoname(daemon->icmp6fd, param.iface, interface) &&
|
||||||
|
iface_check(AF_LOCAL, NULL, interface))
|
||||||
|
{
|
||||||
|
struct iname *tmp;
|
||||||
|
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
|
||||||
|
if (tmp->name && (strcmp(tmp->name, interface) == 0))
|
||||||
|
break;
|
||||||
|
if (!tmp)
|
||||||
send_ra(param.iface, interface, NULL);
|
send_ra(param.iface, interface, NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return next_event;
|
return next_event;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,8 +514,10 @@ static int iface_search(struct in6_addr *local, int prefix,
|
|||||||
if (context->ra_time != 0 && difftime(context->ra_time, param->now) <= 0.0)
|
if (context->ra_time != 0 && difftime(context->ra_time, param->now) <= 0.0)
|
||||||
{
|
{
|
||||||
/* found an interface that's overdue for RA determine new
|
/* found an interface that's overdue for RA determine new
|
||||||
timeout value and zap other contexts on the same interface
|
timeout value and arrange for RA to be sent unless interface is
|
||||||
so they don't timeout independently .*/
|
still doing DAD.*/
|
||||||
|
|
||||||
|
if (!dad)
|
||||||
param->iface = if_index;
|
param->iface = if_index;
|
||||||
|
|
||||||
if (difftime(param->now, ra_short_period_start) < 60.0)
|
if (difftime(param->now, ra_short_period_start) < 60.0)
|
||||||
@@ -516,6 +527,14 @@ static int iface_search(struct in6_addr *local, int prefix,
|
|||||||
/* range 450 - 600 */
|
/* range 450 - 600 */
|
||||||
context->ra_time = param->now + 450 + (rand16()/440);
|
context->ra_time = param->now + 450 + (rand16()/440);
|
||||||
|
|
||||||
|
/* zero timers for other contexts on the same subnet, so they don't timeout
|
||||||
|
independently */
|
||||||
|
for (context = context->next; context; context = context->next)
|
||||||
|
if (prefix == context->prefix &&
|
||||||
|
is_same_net6(local, &context->start6, prefix) &&
|
||||||
|
is_same_net6(local, &context->end6, prefix))
|
||||||
|
context->ra_time = 0;
|
||||||
|
|
||||||
return 0; /* found, abort */
|
return 0; /* found, abort */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-10
@@ -1387,6 +1387,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
|
|||||||
|
|
||||||
if (lease)
|
if (lease)
|
||||||
{
|
{
|
||||||
|
lease_set_interface(lease, int_index, now);
|
||||||
if (override.s_addr != 0)
|
if (override.s_addr != 0)
|
||||||
lease->override = override;
|
lease->override = override;
|
||||||
else
|
else
|
||||||
@@ -1397,16 +1398,6 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
|
|||||||
option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPACK);
|
option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPACK);
|
||||||
option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, ntohl(server_id(context, override, fallback).s_addr));
|
option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, ntohl(server_id(context, override, fallback).s_addr));
|
||||||
|
|
||||||
if (lease)
|
|
||||||
{
|
|
||||||
if (lease->expires == 0)
|
|
||||||
time = 0xffffffff;
|
|
||||||
else
|
|
||||||
time = (unsigned int)difftime(lease->expires, now);
|
|
||||||
option_put(mess, end, OPTION_LEASE_TIME, 4, time);
|
|
||||||
lease_set_interface(lease, int_index, now);
|
|
||||||
}
|
|
||||||
|
|
||||||
do_options(context, mess, end, req_options, hostname, get_domain(mess->ciaddr),
|
do_options(context, mess, end, req_options, hostname, get_domain(mess->ciaddr),
|
||||||
netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid, vendor_class_len, now);
|
netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid, vendor_class_len, now);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user