Hello,

I spent some time looking for a problem we had with Corosync when we activate packet filtering on our machines (the packet filter and Corosync are on the same machine). I eventually realized this problem occurred because we filter the loopback (it's more or less related to bug reports https://bugzilla.redhat.com/show_bug.cgi?id=557513 and https://bugzilla.redhat.com/show_bug.cgi?id=576000 ).

Thing is, even if in the end it was trivial to fix, our packet filter just prevented sendmsg() from sending the packet in a first place, so I didn't even see the packets in my tcpdump session. Having some logs when sendmsg() calls fail could have pointed me to the issue quicker.

I've joined the patch I used to get error messages when sendmsg() fails, hoping it may later help other people as well. The patch was made on the Flatiron branch but seems to apply also to the trunk.

Best regards,
diff --git a/exec/totemudp.c b/exec/totemudp.c
index 33c543c..02bfce7 100644
--- a/exec/totemudp.c
+++ b/exec/totemudp.c
@@ -952,11 +952,18 @@ static inline void ucast_sendmsg (
 
 
 	/*
-	 * Transmit multicast message
+	 * Transmit unicast message
 	 * An error here is recovered by totemsrp
 	 */
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_ucast,
 		MSG_NOSIGNAL);
+	if ( res < 0 )
+	{
+		char error_str[100];
+		strerror_r (errno, error_str, sizeof(error_str));
+		log_printf (instance->totemudp_log_level_debug,
+				"sendmsg(ucast) failed (non-critical): %s\n", error_str);
+	}
 }
 
 static inline void mcast_sendmsg (
@@ -1036,6 +1043,13 @@ static inline void mcast_sendmsg (
 	 */
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast,
 		MSG_NOSIGNAL);
+	if ( res < 0 )
+	{
+		char error_str[100];
+		strerror_r (errno, error_str, sizeof(error_str));
+		log_printf (instance->totemudp_log_level_debug,
+				"sendmsg(mcast) failed (non-critical): %s\n", error_str);
+	}
 }
 
 static void totemudp_mcast_thread_state_constructor (
@@ -1110,6 +1124,13 @@ static void totemudp_mcast_worker_fn (void *thread_state, void *work_item_in)
 	 */
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast,
 		MSG_NOSIGNAL);
+	if ( res < 0 )
+	{
+		char error_str[100];
+		strerror_r (errno, error_str, sizeof(error_str));
+		log_printf (instance->totemudp_log_level_debug,
+				"sendmsg(mcast) failed (non-critical): %s\n", error_str);
+	}
 }
 
 int totemudp_finalize (
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to