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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
17c9ed67
Commit
17c9ed67
authored
Feb 10, 2018
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix perfschema tests in debug mode.
Correctly initialize fake IPs.
parent
e3cf5779
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
sql/hostname.cc
sql/hostname.cc
+12
-5
sql/sql_connect.cc
sql/sql_connect.cc
+1
-1
No files found.
sql/hostname.cc
View file @
17c9ed67
...
...
@@ -701,11 +701,13 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
static
struct
addrinfo
debug_addr_info
[
2
];
/* Simulating ipv4 192.0.2.126 */
debug_addr
=
&
debug_sock_addr
[
0
];
inet_pton
(
AF_INET
,
"192.0.2.126"
,
debug_addr
);
debug_addr
->
sin_family
=
AF_INET
;
inet_pton
(
AF_INET
,
"192.0.2.126"
,
&
debug_addr
->
sin_addr
);
/* Simulating ipv4 192.0.2.127 */
debug_addr
=
&
debug_sock_addr
[
1
];
inet_pton
(
AF_INET
,
"192.0.2.127"
,
debug_addr
);
debug_addr
->
sin_family
=
AF_INET
;
inet_pton
(
AF_INET
,
"192.0.2.127"
,
&
debug_addr
->
sin_addr
);
debug_addr_info
[
0
].
ai_addr
=
(
struct
sockaddr
*
)
&
debug_sock_addr
[
0
];
debug_addr_info
[
0
].
ai_addrlen
=
sizeof
(
struct
sockaddr_in
);
...
...
@@ -731,11 +733,13 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
static
struct
addrinfo
debug_addr_info
[
2
];
/* Simulating ipv4 192.0.2.5 */
debug_addr
=
&
debug_sock_addr
[
0
];
inet_pton
(
AF_INET
,
"192.0.2.5"
,
debug_addr
);
debug_addr
->
sin_family
=
AF_INET
;
inet_pton
(
AF_INET
,
"192.0.2.5"
,
&
debug_addr
->
sin_addr
);
/* Simulating ipv4 192.0.2.4 */
debug_addr
=
&
debug_sock_addr
[
1
];
inet_pton
(
AF_INET
,
"192.0.2.5"
,
debug_addr
);
debug_addr
->
sin_family
=
AF_INET
;
inet_pton
(
AF_INET
,
"192.0.2.4"
,
&
debug_addr
->
sin_addr
);
debug_addr_info
[
0
].
ai_addr
=
(
struct
sockaddr
*
)
&
debug_sock_addr
[
0
];
debug_addr_info
[
0
].
ai_addrlen
=
sizeof
(
struct
sockaddr_in
);
...
...
@@ -768,13 +772,16 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
static
struct
addrinfo
debug_addr_info
[
2
];
/* Simulating ipv6 2001:DB8::6:7E */
debug_addr
=
&
debug_sock_addr
[
0
];
debug_addr
->
sin6_family
=
AF_INET6
;
ip6
=
&
debug_addr
->
sin6_addr
;
inet_pton
(
AF_INET6
,
"2001:DB8::6:7E"
,
ip6
);
/* Simulating ipv6 2001:DB8::6:7F */
debug_addr
=
&
debug_sock_addr
[
1
];
debug_addr
->
sin6_family
=
AF_INET6
;
ip6
=
&
debug_addr
->
sin6_addr
;
inet_pton
(
AF_INET6
,
"2001:DB8::6:7E"
,
ip6
);
inet_pton
(
AF_INET6
,
"2001:DB8::6:7F"
,
ip6
);
debug_addr_info
[
0
].
ai_addr
=
(
struct
sockaddr
*
)
&
debug_sock_addr
[
0
];
debug_addr_info
[
0
].
ai_addrlen
=
sizeof
(
struct
sockaddr_in6
);
debug_addr_info
[
0
].
ai_next
=
&
debug_addr_info
[
1
];
...
...
sql/sql_connect.cc
View file @
17c9ed67
...
...
@@ -979,7 +979,7 @@ static int check_connection(THD *thd)
struct
in_addr
*
ip4
=
&
((
struct
sockaddr_in
*
)
sa
)
->
sin_addr
;
/* See RFC 5737, 192.0.2.0/24 is reserved. */
const
char
*
fake
=
"192.0.2.4"
;
inet_pton
(
AF_INET
,
fake
,
&
ip4
);
inet_pton
(
AF_INET
,
fake
,
ip4
);
strcpy
(
ip
,
fake
);
peer_rc
=
0
;
}
...
...
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