Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
12b60492
Commit
12b60492
authored
Oct 31, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Make SO_REUSEADDR and SO_EXCLUSIVEADDRUSE mutually exclusive.
parent
d656cb20
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
sock.c
dlls/ws2_32/tests/sock.c
+2
-2
sock.c
server/sock.c
+12
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
12b60492
...
...
@@ -2353,7 +2353,7 @@ static void test_reuseaddr(void)
value
=
1
;
rc
=
setsockopt
(
s1
,
SOL_SOCKET
,
SO_EXCLUSIVEADDRUSE
,
(
char
*
)
&
value
,
sizeof
(
value
));
todo_wine
ok
(
rc
==
SOCKET_ERROR
&&
WSAGetLastError
()
==
WSAEINVAL
,
"got rc %d, error %d.
\n
"
,
rc
,
WSAGetLastError
());
ok
(
rc
==
SOCKET_ERROR
&&
WSAGetLastError
()
==
WSAEINVAL
,
"got rc %d, error %d.
\n
"
,
rc
,
WSAGetLastError
());
value
=
0
;
rc
=
setsockopt
(
s1
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
value
,
sizeof
(
value
));
...
...
@@ -2364,7 +2364,7 @@ static void test_reuseaddr(void)
value
=
1
;
rc
=
setsockopt
(
s1
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
value
,
sizeof
(
value
));
todo_wine
ok
(
rc
==
SOCKET_ERROR
&&
WSAGetLastError
()
==
WSAEINVAL
,
"got rc %d, error %d.
\n
"
,
rc
,
WSAGetLastError
());
ok
(
rc
==
SOCKET_ERROR
&&
WSAGetLastError
()
==
WSAEINVAL
,
"got rc %d, error %d.
\n
"
,
rc
,
WSAGetLastError
());
closesocket
(
s1
);
...
...
server/sock.c
View file @
12b60492
...
...
@@ -3091,6 +3091,13 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
}
reuse
=
*
(
int
*
)
get_req_data
();
if
(
reuse
&&
sock
->
exclusiveaddruse
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
if
(
is_tcp_socket
(
sock
))
ret
=
0
;
else
...
...
@@ -3116,6 +3123,11 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
}
exclusive
=
*
(
int
*
)
get_req_data
();
if
(
exclusive
&&
sock
->
reuseaddr
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
sock
->
exclusiveaddruse
=
!!
exclusive
;
return
;
}
...
...
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