NDIS IM question
"Dmitriy Gubarkov" <begger@ukr.net>
I have to redirect packets from specified port to another one.
So I'm using passthru as a base and I implemented Send and Receive handlers
to change ports.
Everything seems to be ok with incoming packets, but outgoing packets has
invalid checksum. But I've made a correct calculation and replace old one
with new checksum and client got packet with old checksum. It strange I
can't even imagine what could be a reason. Besides new port value is exists
while checksum is old, and this happens only in Send handler.
Can anybody point me where to look for possible reason or maybe I missed
something?
"Thomas F. Divine" <pcausa@hotmail.com>
Perhaps this is related to NDIS task offload - checksum offload.
In your IM driver you need to monitor the queries and sets related to NDIS
task offload. If the adapter offers hardware checksum offload and the TCP/IP
driver has elected to use it, then send packets will not have the correct
checksum because it is understood that the hardware will compute them. Going
further, if you compute a correct checksum in your IM filter, the outgoing
checksum will be incorrect because the hardware will make an additional
computation.
Read the info on the checksum task offload. There you will find how to
detect when offload is enabled and the expected values to be put into the
packet checksum field, etc . for this scheme to work.