]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Fix bug when >1 IPv6 address supplied to Dbus SetServers method.
authorSimon Kelley <simon@thekelleys.org.uk>
Sun, 8 Jun 2014 20:51:29 +0000 (21:51 +0100)
committerSimon Kelley <simon@thekelleys.org.uk>
Sun, 8 Jun 2014 20:51:29 +0000 (21:51 +0100)
src/dbus.c

index 93c597cc9734a2a969150a2c8b1a5d2c3865625a..469644289a6e42029104222dfaf13ed539d2b5ca 100644 (file)
@@ -156,13 +156,16 @@ static void dbus_read_servers(DBusMessage *message)
              dbus_message_iter_get_basic(&iter, &p[i]);
              dbus_message_iter_next (&iter);
              if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_BYTE)
-               break;
+               {
+                 i++;
+                 break;
+               }
            }
 
 #ifndef HAVE_IPV6
          my_syslog(LOG_WARNING, _("attempt to set an IPv6 server address via DBus - no IPv6 support"));
 #else
-         if (i == sizeof(struct in6_addr)-1)
+         if (i == sizeof(struct in6_addr))
            {
              memcpy(&addr.in6.sin6_addr, p, sizeof(struct in6_addr));
 #ifdef HAVE_SOCKADDR_SA_LEN