Skip to content

Commit

Permalink
MDEV-20627 : Galera 4 not able to report proper wsrep_incoming_addresses
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jan Lindström committed May 30, 2022
1 parent 99c8aed commit c8fabbe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sql/wsrep_mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit c8fabbe

Please sign in to comment.