Commit 006c1623 authored by Simon Kelley's avatar Simon Kelley

Fix bug when >1 IPv6 address supplied to Dbus SetServers method.

parent 6799a466
...@@ -156,13 +156,16 @@ static void dbus_read_servers(DBusMessage *message) ...@@ -156,13 +156,16 @@ static void dbus_read_servers(DBusMessage *message)
dbus_message_iter_get_basic(&iter, &p[i]); dbus_message_iter_get_basic(&iter, &p[i]);
dbus_message_iter_next (&iter); dbus_message_iter_next (&iter);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_BYTE) if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_BYTE)
break; {
i++;
break;
}
} }
#ifndef HAVE_IPV6 #ifndef HAVE_IPV6
my_syslog(LOG_WARNING, _("attempt to set an IPv6 server address via DBus - no IPv6 support")); my_syslog(LOG_WARNING, _("attempt to set an IPv6 server address via DBus - no IPv6 support"));
#else #else
if (i == sizeof(struct in6_addr)-1) if (i == sizeof(struct in6_addr))
{ {
memcpy(&addr.in6.sin6_addr, p, sizeof(struct in6_addr)); memcpy(&addr.in6.sin6_addr, p, sizeof(struct in6_addr));
#ifdef HAVE_SOCKADDR_SA_LEN #ifdef HAVE_SOCKADDR_SA_LEN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment