[pve-devel] [PATCH] add ipv6 multicast kernel bug workaround

Wolfgang Bumiller w.bumiller at proxmox.com
Thu May 21 13:46:53 CEST 2015


Add a workaround for an ipv6 multicast kernel bug where ipv6 multicast
interfaces are rendered inert when another socket gets bound after them.
This problem got fixed somewhere between 3.10 and 3.16, so this patch
can be removed when we upgrade the kernel accordingly.
---
 ...tem-swap-unicast-and-multicast-bind-order.patch | 58 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 59 insertions(+)
 create mode 100644 debian/patches/0001-totem-swap-unicast-and-multicast-bind-order.patch

diff --git a/debian/patches/0001-totem-swap-unicast-and-multicast-bind-order.patch b/debian/patches/0001-totem-swap-unicast-and-multicast-bind-order.patch
new file mode 100644
index 0000000..c75a4cd
--- /dev/null
+++ b/debian/patches/0001-totem-swap-unicast-and-multicast-bind-order.patch
@@ -0,0 +1,58 @@
+From 59e09c68f75807d99ebcde84aa3cbfaf4d15d0d4 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller at proxmox.com>
+Date: Tue, 19 May 2015 13:57:54 +0200
+Subject: [PATCH] totem: swap unicast and multicast bind order
+
+For some reason binding the unicast socket after the multicast socket
+renders the former inert when using ipv6 on older kernels (tested on
+3.10). This is a workaround for this issue.
+---
+ exec/totemudp.c | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/exec/totemudp.c b/exec/totemudp.c
+index 8ed87ce..86cb330 100644
+--- a/exec/totemudp.c
++++ b/exec/totemudp.c
+@@ -761,18 +761,6 @@ static int totemudp_build_sockets_ip (
+ 	}
+ 
+ 	/*
+-	 * Bind to multicast socket used for multicast receives
+-	 */
+-	totemip_totemip_to_sockaddr_convert(mcast_address,
+-		instance->totem_interface->ip_port, &sockaddr, &addrlen);
+-	res = bind (sockets->mcast_recv, (struct sockaddr *)&sockaddr, addrlen);
+-	if (res == -1) {
+-		LOGSYS_PERROR (errno, instance->totemudp_log_level_warning,
+-				"Unable to bind the socket to receive multicast packets");
+-		return (-1);
+-	}
+-
+-	/*
+ 	 * Create local multicast loop socket
+ 	 */
+ 	if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets->local_mcast_loop) == -1) {
+@@ -870,6 +858,19 @@ static int totemudp_build_sockets_ip (
+ 		return (-1);
+ 	}
+ 
++	/*
++	 * Bind to multicast socket used for multicast receives
++	 */
++	totemip_totemip_to_sockaddr_convert(mcast_address,
++		instance->totem_interface->ip_port, &sockaddr, &addrlen);
++	res = bind (sockets->mcast_recv, (struct sockaddr *)&sockaddr, addrlen);
++	if (res == -1) {
++		LOGSYS_PERROR (errno, instance->totemudp_log_level_warning,
++				"Unable to bind the socket to receive multicast packets");
++		return (-1);
++	}
++
++
+ 	recvbuf_size = MCAST_SOCKET_BUFFER_SIZE;
+ 	sendbuf_size = MCAST_SOCKET_BUFFER_SIZE;
+ 	/*
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index 1196261..16025af 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 #corosync-keygen.diff
 #cpg-join-fix.diff
 #disable-sched-rr.patch
+0001-totem-swap-unicast-and-multicast-bind-order.patch
-- 
2.1.4




More information about the pve-devel mailing list