diff --git a/src/add-ons/kernel/network/stack/link.cpp b/src/add-ons/kernel/network/stack/link.cpp index a6bc89aeb8..502fb3b6a5 100644 --- a/src/add-ons/kernel/network/stack/link.cpp +++ b/src/add-ons/kernel/network/stack/link.cpp @@ -39,13 +39,20 @@ static status_t link_monitor_data(void *cookie, net_buffer *packet) { link_protocol *protocol = (link_protocol *)cookie; - + // we need to make a clone for that buffer and pass it to the socket net_buffer *buffer = gNetBufferModule.clone(packet, false); if (buffer == NULL) return B_NO_MEMORY; - return fifo_enqueue_buffer(&protocol->fifo, buffer); + status_t status = fifo_enqueue_buffer(&protocol->fifo, buffer); + if (status >= B_OK) + notify_socket(protocol->socket, B_SELECT_READ, + protocol->fifo.current_bytes); + else + gNetBufferModule.free(buffer); + + return status; }