From 59ba782a72b3da4f50987e32053d9dee094ff43f Mon Sep 17 00:00:00 2001
From: Robert Ricci <ricci@cs.utah.edu>
Date: Wed, 6 Sep 2006 17:57:29 +0000
Subject: [PATCH] Add a check for TCP window scaling, which is not yet
 supported

---
 pelab/magent/PacketSensor.cc | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/pelab/magent/PacketSensor.cc b/pelab/magent/PacketSensor.cc
index aa04892846..15baf5e349 100644
--- a/pelab/magent/PacketSensor.cc
+++ b/pelab/magent/PacketSensor.cc
@@ -41,6 +41,21 @@ Time const & PacketSensor::getAckedSendTime(void) const
 
 void PacketSensor::localSend(PacketInfo * packet)
 {
+  /*
+   * Check for window scaling, which is not supported yet by this code. This
+   * option is only legal on SACK packets. If we decide to support window
+   * scaling in the future, it might be better to move it to some other sensor
+   */
+  if (packet->tcp->syn) {
+    list<Option>::iterator opt;
+    for (opt = packet->tcpOptions->begin();
+         opt != packet->tcpOptions->end();
+         ++opt) {
+      if (opt->type == TCPOPT_WINDOW) {
+        logWrite(ERROR,"TCP window scaling in use - not supported!");
+      }
+    }
+  }
   // Assume this packet is not a retransmit unless proven otherwise
   isRetransmit = false;
   if (state->getState() == StateSensor::ESTABLISHED)
-- 
GitLab