Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
627caa30
Commit
627caa30
authored
Aug 06, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the error message when getaddrinfo() fails. on windows "*" doesn't mean "any address"
parent
75f0f170
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
sql/mysqld.cc
sql/mysqld.cc
+10
-4
No files found.
sql/mysqld.cc
View file @
627caa30
...
...
@@ -2366,6 +2366,7 @@ static MYSQL_SOCKET activate_tcp_port(uint port)
int
error
;
int
arg
;
char
port_buf
[
NI_MAXSERV
];
const
char
*
real_bind_addr_str
;
MYSQL_SOCKET
ip_sock
=
MYSQL_INVALID_SOCKET
;
DBUG_ENTER
(
"activate_tcp_port"
);
DBUG_PRINT
(
"general"
,(
"IP Socket is %d"
,
port
));
...
...
@@ -2374,13 +2375,19 @@ static MYSQL_SOCKET activate_tcp_port(uint port)
hints
.
ai_flags
=
AI_PASSIVE
;
hints
.
ai_socktype
=
SOCK_STREAM
;
hints
.
ai_family
=
AF_UNSPEC
;
if
(
my_bind_addr_str
&&
strcmp
(
my_bind_addr_str
,
"*"
)
==
0
)
real_bind_addr_str
=
NULL
;
// windows doesn't seem to support * here
else
real_bind_addr_str
=
my_bind_addr_str
;
my_snprintf
(
port_buf
,
NI_MAXSERV
,
"%d"
,
port
);
error
=
getaddrinfo
(
my
_bind_addr_str
,
port_buf
,
&
hints
,
&
ai
);
error
=
getaddrinfo
(
real
_bind_addr_str
,
port_buf
,
&
hints
,
&
ai
);
if
(
error
!=
0
)
{
DBUG_PRINT
(
"error"
,(
"Got error: %d from getaddrinfo()"
,
error
));
sql_perror
(
ER_DEFAULT
(
ER_IPSOCK_ERROR
));
/* purecov: tested */
sql_print_error
(
"%s: %s"
,
ER_DEFAULT
(
ER_IPSOCK_ERROR
),
gai_strerror
(
error
));
unireg_abort
(
1
);
/* purecov: tested */
}
...
...
@@ -2389,8 +2396,7 @@ static MYSQL_SOCKET activate_tcp_port(uint port)
because we later switch off IPV6_V6ONLY, so ipv6 wildcard
addresses will work for ipv4 too
*/
if
((
my_bind_addr_str
==
NULL
||
strcmp
(
my_bind_addr_str
,
"*"
)
==
0
)
&&
ai
->
ai_family
==
AF_INET
&&
ai
->
ai_next
if
(
!
real_bind_addr_str
&&
ai
->
ai_family
==
AF_INET
&&
ai
->
ai_next
&&
ai
->
ai_next
->
ai_family
==
AF_INET6
)
{
a
=
ai
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment