]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
Merge remote-tracking branch 'ms/dhcp-rfc2136-broken-down' into next
[people/pmueller/ipfire-2.x.git] / src / patches / dnsmasq / 005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
1 From 9cdcfe9f19ffd45bac4e5b459879bf7c50a287ed Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Wed, 26 Aug 2015 22:38:08 +0100
4 Subject: [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
10 diff --git a/src/network.c b/src/network.c
11 index 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 --
49 1.7.10.4
50