networkprotocols/tcpipv4v6prt/src/tcp.cpp
changeset 61 2fc972553898
parent 37 052078dda061
equal deleted inserted replaced
56:ea8d11a88e23 61:2fc972553898
   261 		info->iDstAddr.SetPort(pkt.iHdr->DstPort());
   261 		info->iDstAddr.SetPort(pkt.iHdr->DstPort());
   262 
   262 
   263 #ifdef _LOG
   263 #ifdef _LOG
   264 		LogPacket('<', seg, info, info->iOffset);
   264 		LogPacket('<', seg, info, info->iOffset);
   265 		pkt.Set(seg, info->iOffset, pkt.iHdr->HeaderLength()); // LogPacket() may have realigned the header.
   265 		pkt.Set(seg, info->iOffset, pkt.iHdr->HeaderLength()); // LogPacket() may have realigned the header.
       
   266 		
       
   267 		if (!pkt.iHdr)
       
   268 		    {
       
   269 		    LOG(Log::Printf(_L("\ttcp Process() header alignment failed. Packet discarded")));
       
   270 		    seg.Free();
       
   271 		    return;
       
   272 		    }
   266 #endif
   273 #endif
   267 
   274 
   268 		// Verify TCP checksum
   275 		// Verify TCP checksum
   269 		if (!pkt.VerifyChecksum(seg, info, info->iOffset))
   276 		if (!pkt.VerifyChecksum(seg, info, info->iOffset))
   270 			{
   277 			{