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
9f1b1bef
Commit
9f1b1bef
authored
Oct 11, 2012
by
Erich Hoover
Committed by
Alexandre Julliard
Oct 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Silence error when binding to loopback adapter.
parent
69922c67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
socket.c
dlls/ws2_32/socket.c
+4
-3
No files found.
dlls/ws2_32/socket.c
View file @
9f1b1bef
...
@@ -2146,13 +2146,14 @@ static BOOL interface_bind( SOCKET s, int fd, struct sockaddr *addr )
...
@@ -2146,13 +2146,14 @@ static BOOL interface_bind( SOCKET s, int fd, struct sockaddr *addr )
{
{
struct
sockaddr_in
*
in_sock
=
(
struct
sockaddr_in
*
)
addr
;
struct
sockaddr_in
*
in_sock
=
(
struct
sockaddr_in
*
)
addr
;
unsigned
int
sock_type
=
0
,
optlen
=
sizeof
(
sock_type
);
unsigned
int
sock_type
=
0
,
optlen
=
sizeof
(
sock_type
);
in_addr_t
bind_addr
=
in_sock
->
sin_addr
.
s_addr
;
PIP_ADAPTER_INFO
adapters
=
NULL
,
adapter
;
PIP_ADAPTER_INFO
adapters
=
NULL
,
adapter
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
DWORD
adap_size
;
DWORD
adap_size
;
int
enable
=
1
;
int
enable
=
1
;
if
(
in_sock
->
sin_addr
.
s_addr
==
htonl
(
WS_INADDR_ANY
))
if
(
bind_addr
==
htonl
(
WS_INADDR_ANY
)
||
bind_addr
==
htonl
(
WS_INADDR_LOOPBACK
))
return
FALSE
;
/* Not binding to
specific interface, uses default route
*/
return
FALSE
;
/* Not binding to
a network adapter, special interface binding unnecessary.
*/
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_TYPE
,
&
sock_type
,
&
optlen
)
==
-
1
||
sock_type
!=
SOCK_DGRAM
)
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_TYPE
,
&
sock_type
,
&
optlen
)
==
-
1
||
sock_type
!=
SOCK_DGRAM
)
return
FALSE
;
/* Special interface binding is only necessary for UDP datagrams. */
return
FALSE
;
/* Special interface binding is only necessary for UDP datagrams. */
if
(
GetAdaptersInfo
(
NULL
,
&
adap_size
)
!=
ERROR_BUFFER_OVERFLOW
)
if
(
GetAdaptersInfo
(
NULL
,
&
adap_size
)
!=
ERROR_BUFFER_OVERFLOW
)
...
@@ -2165,7 +2166,7 @@ static BOOL interface_bind( SOCKET s, int fd, struct sockaddr *addr )
...
@@ -2165,7 +2166,7 @@ static BOOL interface_bind( SOCKET s, int fd, struct sockaddr *addr )
{
{
in_addr_t
adapter_addr
=
(
in_addr_t
)
inet_addr
(
adapter
->
IpAddressList
.
IpAddress
.
String
);
in_addr_t
adapter_addr
=
(
in_addr_t
)
inet_addr
(
adapter
->
IpAddressList
.
IpAddress
.
String
);
if
(
in_sock
->
sin_addr
.
s
_addr
==
adapter_addr
)
if
(
bind
_addr
==
adapter_addr
)
{
{
#if defined(IP_BOUND_IF)
#if defined(IP_BOUND_IF)
/* IP_BOUND_IF sets both the incoming and outgoing restriction at once */
/* IP_BOUND_IF sets both the incoming and outgoing restriction at once */
...
...
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