From: Alexander Aring Date: Tue, 3 Nov 2020 01:04:26 +0000 (-0500) Subject: fs: dlm: fix check for multi-homed hosts X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1a26bfafbce0f2ec8cfe04d9cdcaead0e6dd58ec;p=linux.git fs: dlm: fix check for multi-homed hosts This patch will use the runtime array size dlm_local_count variable to check the actual size of the dlm_local_addr array. There exists currently a cleanup bug, because the tcp_listen_for_all() functionality might check on a dangled pointer. Signed-off-by: Alexander Aring Signed-off-by: David Teigland --- diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index b042ef56eba6e..f7e86791a0825 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1288,7 +1288,7 @@ out: static int tcp_listen_for_all(void) { /* We don't support multi-homed hosts */ - if (dlm_local_addr[1] != NULL) { + if (dlm_local_count > 1) { log_print("TCP protocol can't handle multi-homed hosts, " "try SCTP"); return -EINVAL;