* when connect()ing an UDP socket, we need to set the local address to the
default address of the outgoing interface as a side-effect git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34989 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -315,6 +315,15 @@ UdpDomainSupport::ConnectEndpoint(UdpEndpoint *endpoint,
|
|||||||
status_t status = endpoint->PeerAddress().SetTo(address);
|
status_t status = endpoint->PeerAddress().SetTo(address);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
struct net_route *routeToDestination
|
||||||
|
= gDatalinkModule->get_route(fDomain, address);
|
||||||
|
if (routeToDestination) {
|
||||||
|
status = endpoint->LocalAddress().SetTo(
|
||||||
|
routeToDestination->interface->address);
|
||||||
|
gDatalinkModule->put_route(fDomain, routeToDestination);
|
||||||
|
if (status < B_OK)
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need to activate no matter whether or not we have just disconnected,
|
// we need to activate no matter whether or not we have just disconnected,
|
||||||
|
|||||||
Reference in New Issue
Block a user