diff --git a/src/add-ons/kernel/network/protocols/udp/udp.cpp b/src/add-ons/kernel/network/protocols/udp/udp.cpp index 9be6d767bb..8d74e7c6fc 100644 --- a/src/add-ons/kernel/network/protocols/udp/udp.cpp +++ b/src/add-ons/kernel/network/protocols/udp/udp.cpp @@ -384,7 +384,10 @@ UdpDomainSupport::ConnectEndpoint(UdpEndpoint *endpoint, // we need to activate no matter whether or not we have just disconnected, // as calling connect() always triggers an implicit bind(): - return _BindEndpoint(endpoint, *endpoint->LocalAddress()); + status_t status = _BindEndpoint(endpoint, *endpoint->LocalAddress()); + if (status == B_OK) + gSocketModule->set_connected(endpoint->Socket()); + return status; } diff --git a/src/add-ons/kernel/network/stack/net_socket.cpp b/src/add-ons/kernel/network/stack/net_socket.cpp index 414acc5e2c..4ca9ebbf20 100644 --- a/src/add-ons/kernel/network/stack/net_socket.cpp +++ b/src/add-ons/kernel/network/stack/net_socket.cpp @@ -829,6 +829,11 @@ socket_connected(net_socket* _socket) TRACE("socket_connected(%p)\n", socket); + if (socket->parent == NULL) { + socket->is_connected = true; + return B_OK; + } + BReference parent = socket->parent.GetReference(); if (parent.Get() == NULL) return B_BAD_VALUE;