  
  }
 --- dist-ns-allinone-2.1b9/ns-2.1b9/common/timer-handler.cc	Fri Sep 11 19:32:28 1998
-+++ ns-allinone-2.1b9/ns-2.1b9/common/timer-handler.cc	Fri Nov  8 17:04:05 2002
++++ ns-allinone-2.1b9/ns-2.1b9/common/timer-handler.cc	Fri Nov  8 19:01:45 2002
 @@ -76,3 +76,40 @@
  	if (status_ == TIMER_HANDLING)
  		status_ = TIMER_IDLE;

 
 /*
  * simulator schedules TapAgent::recv which calls sendpkt
@@ -231,23 +492,24 @@
   unsigned short dglen;
   struct ip *ipheader;
 

+  
+  /* TCP header info from the grabbed packet. */
+  unsigned char tcphlen;
 
+  if (net_incoming_->mode() != O_RDWR && net_incoming_->mode() != O_RDONLY) {
+    fprintf(stderr,
+	    "IPTapAgent(%s): recvpkt called while in write-only mode!\n",
