summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2022-05-30 11:11:48 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2022-05-30 12:43:46 +0300
commitc8fabbed425140332038537c8baeaa33c96a9db5 (patch)
tree25707f06c24cb36bc0c15d517197f51f364c01ea /sql
parent99c8aed00d832d838ee4b746dc6ae18a8f281709 (diff)
downloadmariadb-git-c8fabbed425140332038537c8baeaa33c96a9db5.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/wsrep_mysqld.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index d53fb7320e4..3a5db89d02b 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -593,7 +593,7 @@ static std::string wsrep_server_incoming_address()
bool is_ipv6= false;
unsigned int my_bind_ip= INADDR_ANY; // default if not set
- if (my_bind_addr_str && strlen(my_bind_addr_str) &&
+ if (my_bind_addr_str && strlen(my_bind_addr_str) &&
strcmp(my_bind_addr_str, "*") != 0)
{
my_bind_ip= wsrep_check_ip(my_bind_addr_str, &is_ipv6);
@@ -658,9 +658,13 @@ static std::string wsrep_server_incoming_address()
snprintf(inc_addr, inc_addr_max, fmt, addr.get_address(), port);
}
-
+
done:
- ret= wsrep_node_incoming_address;
+ if (!strlen(inc_addr))
+ ret= wsrep_node_incoming_address;
+ else
+ ret= inc_addr;
+ WSREP_DEBUG("wsrep_incoming_address = %s", ret.c_str());
return ret;
}