]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Suggest solution to ENOMEM error with IPv6 multicast.
authorSimon Kelley <simon@thekelleys.org.uk>
Wed, 26 Aug 2015 21:38:08 +0000 (22:38 +0100)
committerSimon Kelley <simon@thekelleys.org.uk>
Wed, 26 Aug 2015 21:38:08 +0000 (22:38 +0100)
src/network.c

index a1d90c876fc17a349226d7b66c3dbc0db994f021..819302f52cf6df32d2e54a5653893faa5798128b 100644 (file)
@@ -1076,23 +1076,30 @@ void join_multicast(int dienow)
            
            if ((daemon->doing_dhcp6 || daemon->relay6) &&
                setsockopt(daemon->dhcp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
-             err = 1;
+             err = errno;
            
            inet_pton(AF_INET6, ALL_SERVERS, &mreq.ipv6mr_multiaddr);
            
            if (daemon->doing_dhcp6 && 
                setsockopt(daemon->dhcp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
-             err = 1;
+             err = errno;
            
            inet_pton(AF_INET6, ALL_ROUTERS, &mreq.ipv6mr_multiaddr);
            
            if (daemon->doing_ra &&
                setsockopt(daemon->icmp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
-             err = 1;
+             err = errno;
            
            if (err)
              {
                char *s = _("interface %s failed to join DHCPv6 multicast group: %s");
+               errno = err;
+
+#ifdef HAVE_LINUX_NETWORK
+               if (errno == ENOMEM)
+                 my_syslog(LOG_ERR, _("try increasing /proc/sys/net/core/optmem_max"));
+#endif
+
                if (dienow)
                  die(s, iface->name, EC_BADNET);
                else