mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 19:44:58 +00:00
TCP: Collect the payload if present in a packet with FIN set.
This commit is contained in:
parent
25e521f510
commit
f9569db1e5
3 changed files with 9 additions and 1 deletions
|
@ -302,6 +302,10 @@ void handle_tcp(const EthernetFrameHeader& eth, int frame_size)
|
|||
|
||||
if (tcp_packet.has_fin()) {
|
||||
kprintf("handle_tcp: Got FIN, payload_size=%u\n", payload_size);
|
||||
|
||||
if (payload_size != 0)
|
||||
socket->did_receive(ByteBuffer::copy((const byte*)&ipv4_packet, sizeof(IPv4Packet) + ipv4_packet.payload_size()));
|
||||
|
||||
socket->set_ack_number(tcp_packet.sequence_number() + payload_size + 1);
|
||||
socket->send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK);
|
||||
socket->set_state(TCPSocket::State::Disconnecting);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue