NDIS IM, NdisSend() to the USB wireless adapter failure

Hi, all

I want implement a nat.

the two NICs, WAN use PCI card, LAN use USB wireless card.

we can forward(redirect) the packets from LAN adapter to WAN adapter is OK, and the response packet will return to the WAN adapter.

But the receive packet in PtReceivePacket routine of WAN adapter I forward to the LAN adapter faile.

Please see following:

LAN -> WAN
PtReceive()

  1. allocate a new ndis packet, and copy the data from original packet.
  2. modify IP header and transport header, recalculate checksum
  3. call NdisSend() the new packet to the WAN adapter

forward to WAN success :slight_smile:

WAN -> LAN
PtReceivePacket()

  1. allocate a new ndis packet, and copy the data from original packet.
  2. modify IP header and transport header, recalculate checksum
  3. call NdisSend() the new packet to the LAN adapter

and found the PtSendComplete called synchronize, and the Status is NDIS_STATUS_FAILURE
:frowning:

Best regards!
Kandom