diff --git a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp index 7160f9e484..78f90d042f 100644 --- a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp +++ b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp @@ -1260,7 +1260,11 @@ ipv4_send_data(net_protocol *_protocol, net_buffer *buffer) status_t status = sDatalinkModule->get_buffer_route(sDomain, buffer, &route); if (status >= B_OK) { - status = ipv4_send_routed_data(protocol, route, buffer); + if (protocol) + status = protocol->socket->first_protocol->module->send_routed_data( + protocol->socket->first_protocol, route, buffer); + else + status = ipv4_send_routed_data(NULL, route, buffer); sDatalinkModule->put_route(sDomain, route); } diff --git a/src/add-ons/kernel/network/protocols/udp/udp.cpp b/src/add-ons/kernel/network/protocols/udp/udp.cpp index c665e8f01e..8d7b0888b0 100644 --- a/src/add-ons/kernel/network/protocols/udp/udp.cpp +++ b/src/add-ons/kernel/network/protocols/udp/udp.cpp @@ -894,15 +894,10 @@ UdpEndpoint::SendData(net_buffer *buffer) { TRACE_EP("SendData(%p [%lu bytes])", buffer, buffer->size); - net_route *route = NULL; - status_t status = gDatalinkModule->get_buffer_route(Domain(), - buffer, &route); - if (status >= B_OK) { - status = SendRoutedData(buffer, route); - gDatalinkModule->put_route(Domain(), route); - } - - return status; + // This will call into IPv4 which will do all of the obtaining + // routes and other datagram related dirty work and eventually + // call back into our send_routed_data. + return next->module->send_data(next, buffer); }