title: How to redirect TCP packets from protocol layer using NDIS filter driver?
body: <p>I'm writing a NDIS filter driver for windows. Now I face a problem.</p>
  <p>I'm going to redirect TCP packets to a TCP server on the current PC which the NDIS filter driver installs on. For example, the IP address of the current PC is <code>192.168.1.1</code> and there is a TCP server on it which is listening port <code>8000</code>.</p>
  <p>A user enters a URL: <a href="http://192.168.1.10/xxxx" rel="nofollow noreferrer">http://192.168.1.10/xxxx</a> in the IE browser and my NDIS filter driver can absolutely see the <code>TCP SYN</code> packet. I modify the destination IP address of the packet to <code>192.168.1.1</code> and the destination port to <code>8000</code>, because I'm expecting the packet can be redirected to the local TCP server.</p>
  <p>Then I use <code>NdisFIndicateReceiveNetBufferLists()</code> to to inject the NBL into the receiving path instead of sending it to the underlying miniport driver.</p>
  <p>However, it seems that the local TCP server can never get the redirected <code>SYN</code> packet. I don't know where the thing is going wrong. Would anyone help me or give me some advice?</p>
  <p>Thank you very much!</p>