Skip to content

Commit

Permalink
fs: dlm: fix check for multi-homed hosts
Browse files Browse the repository at this point in the history
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 <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Alexander Aring authored and David Teigland committed Nov 10, 2020
1 parent d11ccd4 commit 1a26bfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a26bfa

Please sign in to comment.