aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-11-08 23:21:25 +0000
committersotech117 <michael_foiani@brown.edu>2023-11-08 23:21:25 +0000
commit123562ac8a8b98fabf8669ae7b660d0d9fac176b (patch)
tree8ef063a88c8156e2b2672bd5e116080a9494faca
parenta787b00605d8f89e0978eb9956b516296c85d0e3 (diff)
basic sequence number fix
-rw-r--r--pkg/ipstack/ipstack.go5
-rwxr-xr-xvhostbin3191006 -> 3191134 bytes
-rwxr-xr-xvrouterbin3182993 -> 3183073 bytes
3 files changed, 2 insertions, 3 deletions
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
diff --git a/vhost b/vhost
index 71946eb..97c346a 100755
--- a/vhost
+++ b/vhost
Binary files differ
diff --git a/vrouter b/vrouter
index 707d2d0..f473f0d 100755
--- a/vrouter
+++ b/vrouter
Binary files differ