AbstractSocket: do not bind AF_LOCAL socket when connecting
Fix connection error for AF_LOCAL sockets. Change-Id: I2e822f34e64434ccdbdd484f1647de2a8a6232d7 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7166 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
parent
5014ac9392
commit
33365c2a0d
@ -223,9 +223,10 @@ BAbstractSocket::Connect(const BNetworkAddress& peer, int type,
|
|||||||
fInitStatus = SetTimeout(timeout);
|
fInitStatus = SetTimeout(timeout);
|
||||||
|
|
||||||
if (fInitStatus == B_OK && !IsBound()) {
|
if (fInitStatus == B_OK && !IsBound()) {
|
||||||
|
// Bind to ADDR_ANY, if the address family supports it
|
||||||
BNetworkAddress local;
|
BNetworkAddress local;
|
||||||
local.SetToWildcard(peer.Family());
|
if (local.SetToWildcard(peer.Family()) == B_OK)
|
||||||
fInitStatus = Bind(local, true);
|
fInitStatus = Bind(local, true);
|
||||||
}
|
}
|
||||||
if (fInitStatus != B_OK)
|
if (fInitStatus != B_OK)
|
||||||
return fInitStatus;
|
return fInitStatus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user