  }
  
 +bool PacketDecapsulateIfNeeded(Packet *p) {
-+    hdr_cmn *hc = HDR_CMN(p);
-+    if ( hc->ptype_ != PT_LIVE )
-+	return false;
-+
 +    struct ip *ipheader = (struct ip *)p->accessdata();
 +    if (!ipheader || ipheader->ip_p != IPPROTO_ENCAP )
 +	return false;

  * as there are from the packet capture facility.
  * For every packet received through the callback, it populates the ns packet
  * ttl value and inject it into the simulator by calling target_->recv
@@ -197,14 +312,17 @@
 void
 IPTapAgent::recvpkt()
 {

   ttl = ipheader->ip_ttl;
   if (!(--ttl)) {
     fprintf(stderr,
@@ -174,21 +280,43 @@
   datagramlen = ntohs(ipheader->ip_len);
 
   /* Put all the info in the ns headers. */
-  hdr_cmn *ch = HDR_CMN(p);
+  hdr_cmn *ch;
+  ch = HDR_CMN(p);
   ch->size() = datagramlen;
 
-  hdr_ip *ih = HDR_IP(p);
+  hdr_ip *ih;
+  ih = HDR_IP(p);
   ih->ttl() = ttl;
 
+  /* Route lookups need not be performed here in the new code.
