Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
65dbd2b1
Commit
65dbd2b1
authored
Sep 22, 2007
by
Philip Nilsson
Committed by
Alexandre Julliard
Sep 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add a testcase for binding with IPv6 and IPv4 on the same port.
parent
1399a6ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
sock.c
dlls/ws2_32/tests/sock.c
+48
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
65dbd2b1
...
...
@@ -1909,6 +1909,52 @@ end:
CloseHandle
(
hEvent
);
}
static
void
test_ipv6only
(
void
)
{
SOCKET
v4
=
INVALID_SOCKET
,
v6
=
INVALID_SOCKET
;
struct
sockaddr_in
sin4
;
struct
sockaddr_in6
sin6
;
int
ret
;
memset
(
&
sin4
,
0
,
sizeof
(
sin4
));
sin4
.
sin_family
=
AF_INET
;
sin4
.
sin_port
=
htons
(
SERVERPORT
);
memset
(
&
sin6
,
0
,
sizeof
(
sin6
));
sin6
.
sin6_family
=
AF_INET6
;
sin6
.
sin6_port
=
htons
(
SERVERPORT
);
v6
=
socket
(
AF_INET6
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
(
v6
==
INVALID_SOCKET
)
{
skip
(
"Could not create IPv6 socket (LastError: %d; %d expected if IPv6 not available).
\n
"
,
WSAGetLastError
(),
WSAEAFNOSUPPORT
);
goto
end
;
}
ret
=
bind
(
v6
,
(
struct
sockaddr
*
)
&
sin6
,
sizeof
(
sin6
));
if
(
ret
)
{
skip
(
"Could not bind IPv6 address (LastError: %d).
\n
"
,
WSAGetLastError
());
goto
end
;
}
v4
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
(
v4
==
INVALID_SOCKET
)
{
skip
(
"Could not create IPv4 socket (LastError: %d).
\n
"
,
WSAGetLastError
());
goto
end
;
}
ret
=
bind
(
v4
,
(
struct
sockaddr
*
)
&
sin4
,
sizeof
(
sin4
));
ok
(
!
ret
,
"Could not bind IPv4 address (LastError: %d; %d expected if IPv6 binds to IPv4 as well).
\n
"
,
WSAGetLastError
(),
WSAEADDRINUSE
);
end:
if
(
v4
!=
INVALID_SOCKET
)
closesocket
(
v4
);
if
(
v6
!=
INVALID_SOCKET
)
closesocket
(
v6
);
}
/**************** Main program ***************/
START_TEST
(
sock
)
...
...
@@ -1946,5 +1992,7 @@ START_TEST( sock )
test_send
();
test_write_events
();
test_ipv6only
();
Exit
();
}
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