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
e1a34ce0
Commit
e1a34ce0
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 setsockopt(IPV6_DONTFRAG) implementation to ntdll.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a615e677
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
50 deletions
+23
-50
socket.c
dlls/ntdll/unix/socket.c
+19
-0
socket.c
dlls/ws2_32/socket.c
+3
-50
afd.h
include/wine/afd.h
+1
-0
No files found.
dlls/ntdll/unix/socket.c
View file @
e1a34ce0
...
...
@@ -1840,6 +1840,25 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
return
STATUS_SUCCESS
;
}
case
IOCTL_AFD_WINE_SET_IPV6_DONTFRAG
:
#ifdef IPV6_DONTFRAG
return
do_setsockopt
(
handle
,
io
,
IPPROTO_IPV6
,
IPV6_DONTFRAG
,
in_buffer
,
in_size
);
#elif defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DO) && defined(IPV6_PMTUDISC_DONT)
{
int
value
=
*
(
DWORD
*
)
in_buffer
?
IPV6_PMTUDISC_DO
:
IPV6_PMTUDISC_DONT
;
return
do_setsockopt
(
handle
,
io
,
IPPROTO_IP
,
IPV6_MTU_DISCOVER
,
&
value
,
sizeof
(
value
)
);
}
#else
{
static
int
once
;
if
(
!
once
++
)
FIXME
(
"IPV6_DONTFRAGMENT is not supported on this platform
\n
"
);
return
STATUS_SUCCESS
;
/* fake success */
}
#endif
default:
{
if
((
code
>>
16
)
==
FILE_DEVICE_NETWORK
)
...
...
dlls/ws2_32/socket.c
View file @
e1a34ce0
...
...
@@ -694,54 +694,6 @@ static inline void release_sock_fd( SOCKET s, int fd )
close
(
fd
);
}
static
BOOL
set_dont_fragment
(
SOCKET
s
,
int
level
,
BOOL
value
)
{
int
fd
,
optname
;
if
(
level
==
IPPROTO_IP
)
{
#ifdef IP_DONTFRAG
optname
=
IP_DONTFRAG
;
#elif defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DO) && defined(IP_PMTUDISC_DONT)
optname
=
IP_MTU_DISCOVER
;
value
=
value
?
IP_PMTUDISC_DO
:
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
;
#elif defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DO) && defined(IPV6_PMTUDISC_DONT)
optname
=
IPV6_MTU_DISCOVER
;
value
=
value
?
IPV6_PMTUDISC_DO
:
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
(
!
setsockopt
(
fd
,
level
,
optname
,
&
value
,
sizeof
(
value
)))
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
;
...
...
@@ -3667,6 +3619,9 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
case
WS_IPV6_ADD_MEMBERSHIP
:
return
server_setsockopt
(
s
,
IOCTL_AFD_WINE_SET_IPV6_ADD_MEMBERSHIP
,
optval
,
optlen
);
case
WS_IPV6_DONTFRAG
:
return
server_setsockopt
(
s
,
IOCTL_AFD_WINE_SET_IPV6_DONTFRAG
,
optval
,
optlen
);
#ifdef IPV6_DROP_MEMBERSHIP
case
WS_IPV6_DROP_MEMBERSHIP
:
#endif
...
...
@@ -3679,8 +3634,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
#endif
convert_sockopt
(
&
level
,
&
optname
);
break
;
case
WS_IPV6_DONTFRAG
:
return
set_dont_fragment
(
s
,
IPPROTO_IPV6
,
*
(
BOOL
*
)
optval
)
?
0
:
SOCKET_ERROR
;
case
WS_IPV6_PROTECTION_LEVEL
:
FIXME
(
"IPV6_PROTECTION_LEVEL is ignored!
\n
"
);
return
0
;
...
...
include/wine/afd.h
View file @
e1a34ce0
...
...
@@ -209,6 +209,7 @@ struct afd_get_events_params
#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)
#define IOCTL_AFD_WINE_SET_IPV6_DONTFRAG WINE_AFD_IOC(267)
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