From 123562ac8a8b98fabf8669ae7b660d0d9fac176b Mon Sep 17 00:00:00 2001 From: sotech117 Date: Wed, 8 Nov 2023 23:21:25 +0000 Subject: basic sequence number fix --- pkg/ipstack/ipstack.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pkg/ipstack/ipstack.go') diff --git a/pkg/ipstack/ipstack.go b/pkg/ipstack/ipstack.go index 9ffe34f..4a5fe30 100644 --- a/pkg/ipstack/ipstack.go +++ b/pkg/ipstack/ipstack.go @@ -901,8 +901,8 @@ func HandleTCP(src *Interface, message []byte, hdr *ipv4header.IPv4Header) error tcpHdr := &header.TCPFields{ SrcPort: tcpHdr.DstPort, DstPort: tcpHdr.SrcPort, - SeqNum: tcpHdr.SeqNum, - AckNum: tcpHdr.SeqNum + 1, + SeqNum: startingSeqNum, + AckNum: tcpHdr.SeqNum + 1, // FIXME: in the ACK case, this should be plus the size of the data DataOffset: 20, Flags: 0x10, WindowSize: MAX_WINDOW_SIZE, @@ -919,7 +919,6 @@ func HandleTCP(src *Interface, message []byte, hdr *ipv4header.IPv4Header) error copy(socketEntry.Conn.RecvBuffer.buffer[ptr:ptr+l], tcpPayload) socketEntry.Conn.RecvBuffer.recvNext += l fmt.Println("recvNext: ", socketEntry.Conn.RecvBuffer.recvNext) - fmt.Println("recvBuffer: ", socketEntry.Conn.RecvBuffer.buffer) break } // add to table if available -- cgit v1.2.3-70-g09d2