* Made sure the sockaddr::sa_len field is set correctly for sendto(), and
connect(). * This fixes not working connections whenever the incoming sa_len field happened to be zero. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34669 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -975,6 +975,7 @@ socket_bind(net_socket* socket, const struct sockaddr* address,
|
||||
}
|
||||
|
||||
memcpy(&socket->address, address, sizeof(sockaddr));
|
||||
socket->address.ss_len = sizeof(sockaddr_storage);
|
||||
|
||||
status_t status = socket->first_info->bind(socket->first_protocol,
|
||||
(sockaddr*)address);
|
||||
@@ -1424,6 +1425,7 @@ socket_send(net_socket* socket, msghdr* header, const void* data, size_t length,
|
||||
buffer->flags = flags;
|
||||
memcpy(buffer->source, &socket->address, socket->address.ss_len);
|
||||
memcpy(buffer->destination, address, addressLength);
|
||||
buffer->destination->sa_len = addressLength;
|
||||
|
||||
if (status == B_OK) {
|
||||
status = socket->first_info->send_data(socket->first_protocol,
|
||||
|
||||
Reference in New Issue
Block a user