Skip to content

Commit c8fabbe

Browse files
author
Jan Lindström
committed
MDEV-20627 : Galera 4 not able to report proper wsrep_incoming_addresses
wsrep_server_incoming_address function always returned value of the wsrep_node_incoming_address even when actual incoming address was resolved to inc_addr variable. Fixed by returning inc_addr if it does contain incoming address.
1 parent 99c8aed commit c8fabbe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sql/wsrep_mysqld.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ static std::string wsrep_server_incoming_address()
593593
bool is_ipv6= false;
594594
unsigned int my_bind_ip= INADDR_ANY; // default if not set
595595

596-
if (my_bind_addr_str && strlen(my_bind_addr_str) &&
596+
if (my_bind_addr_str && strlen(my_bind_addr_str) &&
597597
strcmp(my_bind_addr_str, "*") != 0)
598598
{
599599
my_bind_ip= wsrep_check_ip(my_bind_addr_str, &is_ipv6);
@@ -658,9 +658,13 @@ static std::string wsrep_server_incoming_address()
658658

659659
snprintf(inc_addr, inc_addr_max, fmt, addr.get_address(), port);
660660
}
661-
661+
662662
done:
663-
ret= wsrep_node_incoming_address;
663+
if (!strlen(inc_addr))
664+
ret= wsrep_node_incoming_address;
665+
else
666+
ret= inc_addr;
667+
WSREP_DEBUG("wsrep_incoming_address = %s", ret.c_str());
664668
return ret;
665669
}
666670

0 commit comments

Comments
 (0)