WinPKFilter: Double packets handling

Home Forums Discussions Support WinPKFilter: Double packets handling

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #4928
    ByTE
    Participant

      When I receive packet from one adapter and redirect it to another adapter, after redirection this packet comes again via filter as outgoing to redirected adapter?
      You understand me?
      For example:


      1. I read packet from adapter 1
      2. I redirect packet to adapter 2 (SendPacketToAdapter) - original packet dropped.
      3. I read packet queue from adapter 2

      I receive redirected packet in step 3 or packet sended directly to adapter 2 and never appears in other queues?
      In documentation no words about this.

      I find in description of “SendPacketToAdapter” function this words:

      INTERMEDIATE_BUFFER.m_Flags should be initialized by combination of NDIS_FLAGS_XXX

      What flags I should set to not receive packets twice?
      What flags I should set to receive packets twice?
      Thank’s.

      #5749
      ByTE
      Participant

        Any comments?
        How I must use INTERMEDIATE_BUFFER.m_Flags with SendPacketToAdapter?
        How this flags influence sending packets?

        #5750
        Vadim Smirnov
        Keymaster

          NDIS_FLAGS_DONT_LOOPBACK and NDIS_FLAGS_SKIP_LOOPBACK prevents the packet from being indicated back. However, these flags are OS/NDIS specific. You can see some details here http://www.ndis.com/papers/loopback.htm

          #5751
          ByTE
          Participant

            Thank’s.
            I try to read this.

            #5752
            ByTE
            Participant

              I read this article, but i don’t have ddk.
              Anybody can say me how NDIS_FLAGS_DONT_LOOPBACK defined in header file in ddk? I need mask (0x????????).

              #5753
              Vadim Smirnov
              Keymaster

                #define NDIS_FLAGS_DONT_LOOPBACK 0x00000080

                #5754
                ByTE
                Participant

                  Thank’s for reply.
                  This is really works!

                  But…

                  With NT 4 this flags does not works.
                  Can I set some flag to packet for detect this packet later, when this packet returns as loopback?
                  Maybe I can set any not used mask in INTERMEDIATE_BUFFER.m_Flags?

                  Any ideas?

                  #5755
                  ByTE
                  Participant

                    Please reply me!

                    #5756
                    Vadim Smirnov
                    Keymaster

                      You can try using MSTCP_FLAG_LOOPBACK_BLOCK for the adapter you work over. It drops incoming packets if source MAC is the same as local MAC. Regretfully there is no way to prevent packet indication on NT4 at all.

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.