Commit c8fabbed authored by Jan Lindström's avatar Jan Lindström

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.
parent 99c8aed0
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment