]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
Merge remote-tracking branch 'ms/ipsec-subnets' into next
[ipfire-2.x.git] / src / patches / dnsmasq / 005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
CommitLineData
f62ac322
MF
1From 9cdcfe9f19ffd45bac4e5b459879bf7c50a287ed Mon Sep 17 00:00:00 2001
2From: Simon Kelley <simon@thekelleys.org.uk>
3Date: Wed, 26 Aug 2015 22:38:08 +0100
4Subject: [PATCH] Suggest solution to ENOMEM error with IPv6 multicast.
5
6---
7 src/network.c | 13 ++++++++++---
8 1 file changed, 10 insertions(+), 3 deletions(-)
9
10diff --git a/src/network.c b/src/network.c
11index a1d90c8..819302f 100644
12--- a/src/network.c
13+++ b/src/network.c
14@@ -1076,23 +1076,30 @@ void join_multicast(int dienow)
15
16 if ((daemon->doing_dhcp6 || daemon->relay6) &&
17 setsockopt(daemon->dhcp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
18- err = 1;
19+ err = errno;
20
21 inet_pton(AF_INET6, ALL_SERVERS, &mreq.ipv6mr_multiaddr);
22
23 if (daemon->doing_dhcp6 &&
24 setsockopt(daemon->dhcp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
25- err = 1;
26+ err = errno;
27
28 inet_pton(AF_INET6, ALL_ROUTERS, &mreq.ipv6mr_multiaddr);
29
30 if (daemon->doing_ra &&
31 setsockopt(daemon->icmp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
32- err = 1;
33+ err = errno;
34
35 if (err)
36 {
37 char *s = _("interface %s failed to join DHCPv6 multicast group: %s");
38+ errno = err;
39+
40+#ifdef HAVE_LINUX_NETWORK
41+ if (errno == ENOMEM)
42+ my_syslog(LOG_ERR, _("try increasing /proc/sys/net/core/optmem_max"));
43+#endif
44+
45 if (dienow)
46 die(s, iface->name, EC_BADNET);
47 else
48--
491.7.10.4
50