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
2d4adfc4
Commit
2d4adfc4
authored
Dec 30, 2013
by
Bruno Jesus
Committed by
Alexandre Julliard
Dec 31, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Use a helper function to set the IPX packet type.
parent
b26ffddc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
22 deletions
+31
-22
socket.c
dlls/ws2_32/socket.c
+31
-22
No files found.
dlls/ws2_32/socket.c
View file @
2d4adfc4
...
@@ -1159,6 +1159,36 @@ convert_socktype_u2w(int unixsocktype) {
...
@@ -1159,6 +1159,36 @@ convert_socktype_u2w(int unixsocktype) {
return
-
1
;
return
-
1
;
}
}
static
int
set_ipx_packettype
(
int
sock
,
int
ptype
)
{
#ifdef HAS_IPX
int
fd
=
get_sock_fd
(
sock
,
0
,
NULL
),
ret
=
0
;
TRACE
(
"trying to set IPX_PTYPE: %d (fd: %d)
\n
"
,
ptype
,
fd
);
/* We try to set the ipx type on ipx socket level. */
#ifdef SOL_IPX
if
(
setsockopt
(
fd
,
SOL_IPX
,
IPX_TYPE
,
&
ptype
,
sizeof
(
ptype
))
==
-
1
)
{
ERR
(
"IPX: could not set ipx option type; expect weird behaviour
\n
"
);
ret
=
SOCKET_ERROR
;
}
#else
{
struct
ipx
val
;
/* Should we retrieve val using a getsockopt call and then
* set the modified one? */
val
.
ipx_pt
=
ptype
;
setsockopt
(
fd
,
0
,
SO_DEFAULT_HEADERS
,
&
val
,
sizeof
(
struct
ipx
));
}
#endif
release_sock_fd
(
sock
,
fd
);
return
ret
;
#else
WARN
(
"IPX support is not enabled, can't set packet type
\n
"
);
return
SOCKET_ERROR
;
#endif
}
/* ----------------------------------- API -----
/* ----------------------------------- API -----
*
*
* Init / cleanup / error checking.
* Init / cleanup / error checking.
...
@@ -4772,28 +4802,7 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
...
@@ -4772,28 +4802,7 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
switch
(
optname
)
switch
(
optname
)
{
{
case
IPX_PTYPE
:
case
IPX_PTYPE
:
fd
=
get_sock_fd
(
s
,
0
,
NULL
);
return
set_ipx_packettype
(
s
,
*
(
int
*
)
optval
);
TRACE
(
"trying to set IPX_PTYPE: %d (fd: %d)
\n
"
,
*
(
const
int
*
)
optval
,
fd
);
/* We try to set the ipx type on ipx socket level. */
#ifdef SOL_IPX
if
(
setsockopt
(
fd
,
SOL_IPX
,
IPX_TYPE
,
optval
,
optlen
)
==
-
1
)
{
ERR
(
"IPX: could not set ipx option type; expect weird behaviour
\n
"
);
release_sock_fd
(
s
,
fd
);
return
SOCKET_ERROR
;
}
#else
{
struct
ipx
val
;
/* Should we retrieve val using a getsockopt call and then
* set the modified one? */
val
.
ipx_pt
=
*
optval
;
setsockopt
(
fd
,
0
,
SO_DEFAULT_HEADERS
,
&
val
,
sizeof
(
struct
ipx
));
}
#endif
release_sock_fd
(
s
,
fd
);
return
0
;
case
IPX_FILTERPTYPE
:
case
IPX_FILTERPTYPE
:
/* Sets the receive filter packet type, at the moment we don't support it */
/* Sets the receive filter packet type, at the moment we don't support it */
...
...
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