From: Alexander Aring Date: Mon, 2 Nov 2020 20:04:26 -0500 Subject: [Cluster-devel] [PATCHv2 RESEND v5.10-rc2 11/13] fs: dlm: fix check for multi-homed hosts In-Reply-To: <20201103010428.1009384-1-aahringo@redhat.com> References: <20201103010428.1009384-1-aahringo@redhat.com> Message-ID: <20201103010428.1009384-12-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- fs/dlm/lowcomms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index b042ef56eba6..f7e86791a082 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1288,7 +1288,7 @@ static int sctp_listen_for_all(struct listen_connection *con) 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; -- 2.26.2