mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
ndb - backport from 5.1
Fix alignment of sockaddr(_in) ndb/src/common/transporter/Transporter.cpp: Fix alignment of sockaddr(_in) ndb/src/mgmsrv/Services.cpp: Fix alignment of sockaddr(_in)
This commit is contained in:
parent
4191b8a39f
commit
a4e32d4e84
2 changed files with 9 additions and 9 deletions
|
@ -100,10 +100,10 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) {
|
|||
}
|
||||
|
||||
{
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr;
|
||||
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
|
||||
int r= getpeername(sockfd, &addr, &addrlen);
|
||||
m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
|
||||
int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen);
|
||||
m_connect_address= (&addr)->sin_addr;
|
||||
}
|
||||
|
||||
bool res = connect_server_impl(sockfd);
|
||||
|
@ -173,10 +173,10 @@ Transporter::connect_client() {
|
|||
}
|
||||
|
||||
{
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr;
|
||||
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
|
||||
int r= getpeername(sockfd, &addr, &addrlen);
|
||||
m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
|
||||
int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen);
|
||||
m_connect_address= (&addr)->sin_addr;
|
||||
}
|
||||
|
||||
bool res = connect_client_impl(sockfd);
|
||||
|
|
|
@ -427,9 +427,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
|
|||
return;
|
||||
}
|
||||
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr;
|
||||
SOCKET_SIZE_TYPE addrlen= sizeof(addr);
|
||||
int r = getpeername(m_socket, &addr, &addrlen);
|
||||
int r = getpeername(m_socket, (struct sockaddr*)&addr, &addrlen);
|
||||
if (r != 0 ) {
|
||||
m_output->println(cmd);
|
||||
m_output->println("result: getpeername(%d) failed, err= %d", m_socket, r);
|
||||
|
@ -441,7 +441,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
|
|||
if(tmp == 0 || !m_allocated_resources->is_reserved(tmp)){
|
||||
BaseString error_string;
|
||||
if (!m_mgmsrv.alloc_node_id(&tmp, (enum ndb_mgm_node_type)nodetype,
|
||||
&addr, &addrlen, error_string)){
|
||||
(struct sockaddr*)&addr, &addrlen, error_string)){
|
||||
const char *alias;
|
||||
const char *str;
|
||||
alias= ndb_mgm_get_node_type_alias_string((enum ndb_mgm_node_type)
|
||||
|
|
Loading…
Reference in a new issue