]> git.proxmox.com Git - corosync-pve.git/blame - debian/patches/0001-totem-swap-unicast-and-multicast-bind-order.patch
remove old sources
[corosync-pve.git] / debian / patches / 0001-totem-swap-unicast-and-multicast-bind-order.patch
CommitLineData
3b3cd2bf
WB
1From 59e09c68f75807d99ebcde84aa3cbfaf4d15d0d4 Mon Sep 17 00:00:00 2001
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Tue, 19 May 2015 13:57:54 +0200
4Subject: [PATCH] totem: swap unicast and multicast bind order
5
6For some reason binding the unicast socket after the multicast socket
7renders the former inert when using ipv6 on older kernels (tested on
83.10). This is a workaround for this issue.
9---
10 exec/totemudp.c | 25 +++++++++++++------------
11 1 file changed, 13 insertions(+), 12 deletions(-)
12
13diff --git a/exec/totemudp.c b/exec/totemudp.c
14index 8ed87ce..86cb330 100644
15--- a/exec/totemudp.c
16+++ b/exec/totemudp.c
17@@ -761,18 +761,6 @@ static int totemudp_build_sockets_ip (
18 }
19
20 /*
21- * Bind to multicast socket used for multicast receives
22- */
23- totemip_totemip_to_sockaddr_convert(mcast_address,
24- instance->totem_interface->ip_port, &sockaddr, &addrlen);
25- res = bind (sockets->mcast_recv, (struct sockaddr *)&sockaddr, addrlen);
26- if (res == -1) {
27- LOGSYS_PERROR (errno, instance->totemudp_log_level_warning,
28- "Unable to bind the socket to receive multicast packets");
29- return (-1);
30- }
31-
32- /*
33 * Create local multicast loop socket
34 */
35 if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets->local_mcast_loop) == -1) {
36@@ -870,6 +858,19 @@ static int totemudp_build_sockets_ip (
37 return (-1);
38 }
39
40+ /*
41+ * Bind to multicast socket used for multicast receives
42+ */
43+ totemip_totemip_to_sockaddr_convert(mcast_address,
44+ instance->totem_interface->ip_port, &sockaddr, &addrlen);
45+ res = bind (sockets->mcast_recv, (struct sockaddr *)&sockaddr, addrlen);
46+ if (res == -1) {
47+ LOGSYS_PERROR (errno, instance->totemudp_log_level_warning,
48+ "Unable to bind the socket to receive multicast packets");
49+ return (-1);
50+ }
51+
52+
53 recvbuf_size = MCAST_SOCKET_BUFFER_SIZE;
54 sendbuf_size = MCAST_SOCKET_BUFFER_SIZE;
55 /*
56--
572.1.4
58