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
d7a8beb0
Commit
d7a8beb0
authored
Dec 05, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Dec 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Filter unset bits when argument is smaller than 32 bits.
parent
14324fec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
socket.c
dlls/ws2_32/socket.c
+1
-0
sock.c
dlls/ws2_32/tests/sock.c
+17
-0
No files found.
dlls/ws2_32/socket.c
View file @
d7a8beb0
...
...
@@ -5013,6 +5013,7 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
{
woptval
=
*
((
const
INT16
*
)
optval
);
optval
=
(
char
*
)
&
woptval
;
woptval
&=
(
1
<<
optlen
*
8
)
-
1
;
optlen
=
sizeof
(
int
);
}
fd
=
get_sock_fd
(
s
,
0
,
NULL
);
...
...
dlls/ws2_32/tests/sock.c
View file @
d7a8beb0
...
...
@@ -1374,6 +1374,23 @@ todo_wine
closesocket
(
s
);
/* Test WS_IP_MULTICAST_TTL with 8, 16, 24 and 32 bits values */
s
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
ok
(
s
!=
INVALID_SOCKET
,
"Failed to create socket
\n
"
);
size
=
sizeof
(
i
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
int
k
,
j
;
const
int
tests
[]
=
{
0xffffff0a
,
0xffff000b
,
0xff00000c
,
0x0000000d
};
err
=
setsockopt
(
s
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
(
char
*
)
&
tests
[
i
],
i
+
1
);
ok
(
!
err
,
"Test [%d] Expected 0, got %d
\n
"
,
i
,
err
);
err
=
getsockopt
(
s
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
(
char
*
)
&
k
,
&
size
);
ok
(
!
err
,
"Test [%d] Expected 0, got %d
\n
"
,
i
,
err
);
j
=
i
!=
3
?
tests
[
i
]
&
((
1
<<
(
i
+
1
)
*
8
)
-
1
)
:
tests
[
i
];
ok
(
k
==
j
,
"Test [%d] Expected 0x%x, got 0x%x
\n
"
,
i
,
j
,
k
);
}
closesocket
(
s
);
/* test SO_PROTOCOL_INFOA invalid parameters */
ok
(
getsockopt
(
INVALID_SOCKET
,
SOL_SOCKET
,
SO_PROTOCOL_INFOA
,
NULL
,
NULL
),
"getsockopt should have failed
\n
"
);
...
...
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