Просмотр исходного кода

totem: don't send garbage onwire if we fail to crypt

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto 14 лет назад
Родитель
Сommit
c3f7d0ef3e
2 измененных файлов с 8 добавлено и 16 удалено
  1. 4 8
      exec/totemudp.c
  2. 4 8
      exec/totemudpu.c

+ 4 - 8
exec/totemudp.c

@@ -268,10 +268,8 @@ static inline void ucast_sendmsg (
 		msg_len,
 		buf_out,
 		&buf_out_len) != 0) {
-		/*
-		 * TODO: how to handle error here
-		 */
-		log_printf(LOGSYS_LEVEL_CRIT, "Unable to crypt? now what?");
+		log_printf(LOGSYS_LEVEL_CRIT, "Error encrypting/signing packet (non-critical)");
+		return;
 	}
 
 	iovec.iov_base = (void *)buf_out;
@@ -330,10 +328,8 @@ static inline void mcast_sendmsg (
 		msg_len,
 		buf_out,
 		&buf_out_len) != 0) {
-		/*
-		 * TODO: how to handle error here
-		 */
-		log_printf(LOGSYS_LEVEL_CRIT, "unable to crypt? now what?");
+		log_printf(LOGSYS_LEVEL_CRIT, "Error encrypting/signing packet (non-critical)");
+		return;
 	}
 
 	iovec.iov_base = (void *)&buf_out;

+ 4 - 8
exec/totemudpu.c

@@ -256,10 +256,8 @@ static inline void ucast_sendmsg (
 		msg_len,
 		buf_out,
 		&buf_out_len) != 0) {
-		/*
-		 * TODO: how to handle error here
-		 */
-		log_printf(LOGSYS_LEVEL_CRIT, "unable to crypt? now what?");
+		log_printf(LOGSYS_LEVEL_CRIT, "Error encrypting/signing packet (non-critical)");
+		return;
 	}
 
 	iovec.iov_base = (void *)buf_out;
@@ -319,10 +317,8 @@ static inline void mcast_sendmsg (
 		msg_len,
 		buf_out,
 		&buf_out_len) != 0) {
-		/*
-		 * TODO: how to handle error here
-		 */
-		log_printf(LOGSYS_LEVEL_CRIT, "Unable to crypt? now what?");
+		log_printf(LOGSYS_LEVEL_CRIT, "Error encrypting/signing packet (non-critical)");
+		return;
 	}
 
 	iovec.iov_base = (void *)buf_out;