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
a615e677
Commit
a615e677
authored
Jul 28, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Move the getsockopt(IPV6_DONTFRAG) implementation to ntdll.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ef54a8c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
56 deletions
+37
-56
socket.c
dlls/ntdll/unix/socket.c
+33
-0
socket.c
dlls/ws2_32/socket.c
+3
-56
afd.h
include/wine/afd.h
+1
-0
No files found.
dlls/ntdll/unix/socket.c
View file @
a615e677
...
...
@@ -1807,6 +1807,39 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
return
do_setsockopt
(
handle
,
io
,
IPPROTO_IPV6
,
IPV6_ADD_MEMBERSHIP
,
in_buffer
,
in_size
);
#endif
case
IOCTL_AFD_WINE_GET_IPV6_DONTFRAG
:
{
socklen_t
len
=
out_size
;
int
ret
;
if
((
status
=
server_get_unix_fd
(
handle
,
0
,
&
fd
,
&
needs_close
,
NULL
,
NULL
)))
return
status
;
#ifdef IPV6_DONTFRAG
ret
=
getsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_DONTFRAG
,
out_buffer
,
&
len
);
#elif defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT)
{
int
value
;
len
=
sizeof
(
value
);
ret
=
getsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_MTU_DISCOVER
,
&
value
,
&
len
);
if
(
!
ret
)
*
(
DWORD
*
)
out_buffer
=
(
value
!=
IPV6_PMTUDISC_DONT
);
}
#else
{
static
int
once
;
if
(
!
once
++
)
FIXME
(
"IPV6_DONTFRAGMENT is not supported on this platform
\n
"
);
ret
=
0
;
/* fake success */
}
#endif
if
(
needs_close
)
close
(
fd
);
if
(
ret
)
return
sock_errno_to_status
(
errno
);
io
->
Information
=
len
;
return
STATUS_SUCCESS
;
}
default:
{
if
((
code
>>
16
)
==
FILE_DEVICE_NETWORK
)
...
...
dlls/ws2_32/socket.c
View file @
a615e677
...
...
@@ -742,60 +742,6 @@ static BOOL set_dont_fragment(SOCKET s, int level, BOOL value)
return
value
;
}
static
BOOL
get_dont_fragment
(
SOCKET
s
,
int
level
,
BOOL
*
out
)
{
int
fd
,
optname
,
value
,
not_expected
;
socklen_t
optlen
=
sizeof
(
value
);
if
(
level
==
IPPROTO_IP
)
{
#ifdef IP_DONTFRAG
optname
=
IP_DONTFRAG
;
not_expected
=
0
;
#elif defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
optname
=
IP_MTU_DISCOVER
;
not_expected
=
IP_PMTUDISC_DONT
;
#else
static
int
once
;
if
(
!
once
++
)
FIXME
(
"IP_DONTFRAGMENT for IPv4 not supported in this platform
\n
"
);
return
TRUE
;
/* fake success */
#endif
}
else
{
#ifdef IPV6_DONTFRAG
optname
=
IPV6_DONTFRAG
;
not_expected
=
0
;
#elif defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT)
optname
=
IPV6_MTU_DISCOVER
;
not_expected
=
IPV6_PMTUDISC_DONT
;
#else
static
int
once
;
if
(
!
once
++
)
FIXME
(
"IP_DONTFRAGMENT for IPv6 not supported in this platform
\n
"
);
return
TRUE
;
/* fake success */
#endif
}
fd
=
get_sock_fd
(
s
,
0
,
NULL
);
if
(
fd
==
-
1
)
return
FALSE
;
if
(
!
getsockopt
(
fd
,
level
,
optname
,
&
value
,
&
optlen
))
{
*
out
=
value
!=
not_expected
;
value
=
TRUE
;
}
else
{
WSASetLastError
(
wsaErrno
());
value
=
FALSE
;
}
release_sock_fd
(
s
,
fd
);
return
value
;
}
struct
per_thread_data
*
get_per_thread_data
(
void
)
{
struct
per_thread_data
*
ptb
=
NtCurrentTeb
()
->
WinSockData
;
...
...
@@ -2511,6 +2457,9 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
case
WS_IPPROTO_IPV6
:
switch
(
optname
)
{
case
WS_IPV6_DONTFRAG
:
return
server_getsockopt
(
s
,
IOCTL_AFD_WINE_GET_IPV6_DONTFRAG
,
optval
,
optlen
);
case
WS_IPV6_MULTICAST_IF
:
case
WS_IPV6_MULTICAST_HOPS
:
case
WS_IPV6_MULTICAST_LOOP
:
...
...
@@ -2529,8 +2478,6 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
}
release_sock_fd
(
s
,
fd
);
return
ret
;
case
WS_IPV6_DONTFRAG
:
return
get_dont_fragment
(
s
,
IPPROTO_IPV6
,
(
BOOL
*
)
optval
)
?
0
:
SOCKET_ERROR
;
default:
FIXME
(
"unrecognized IPv6 option %u
\n
"
,
optname
);
...
...
include/wine/afd.h
View file @
a615e677
...
...
@@ -208,6 +208,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_GET_IP_UNICAST_IF WINE_AFD_IOC(263)
#define IOCTL_AFD_WINE_SET_IP_UNICAST_IF WINE_AFD_IOC(264)
#define IOCTL_AFD_WINE_SET_IPV6_ADD_MEMBERSHIP WINE_AFD_IOC(265)
#define IOCTL_AFD_WINE_GET_IPV6_DONTFRAG WINE_AFD_IOC(266)
struct
afd_create_params
{
...
...
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