Re: Random BugCheck in NdisAllocateMemoryWithTag , Need Help in NDIS driver

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks a lot. I really appreciate this. Yes i just debugged the driver and
that is whats happening.

Can i simply check NDIS_FLAGS_IS_LOOPBACK_PACKET flag to filter out the
packet. When i will see this flag i will indicate it upward and will not
send it.


"Thomas F. Divine [DDK MVP]" <tdivine@xxxxxxxxxxxxxxxx> wrote in message
news:uS82KXSmFHA.2060@xxxxxxxxxxxxxxxxxxxxxxx
> You could be caught in an infinite loop. ESPECIALLY in you see the problem
> when Ethereal (or any other packet sniffer) is running.
>
> Sniffers place the lower-level miniport into promiscuous mode. In this
> mode all packets that are sent will be looped back by the NDIS wrapper and
> will show up in you ProtocolReceive/ProtocolReceivePacket handlers. See
> the "NDIS Loopback Discussion" at NDIS.com for more information on this
> behavior:
>
> http://www.ndis.com/papers/loopback.htm
>
> You must add logic in your receive handlers to detect when you are
> receiving a packet that you have sent yourself. When you detect this you
> need to propogate the receive indication upwards (else the sniffer won't
> see it..) BUT you don't want to re-send this loopback packet (else you
> will be infinitely sending-receiving-sending the same packet).
>
> Good luck,
>
> Thomas F. Divine, Windows DDK MVP
> http://www.pcausa.com
>
> "Rajesh Gupta" <guptarajesh@xxxxxxxxx> wrote in message
> news:O4hrJGSmFHA.3464@xxxxxxxxxxxxxxxxxxxxxxx
>> Thanks a lot for your reply. I really appreciate it.
>>
>> There is no Loop in my PtReceive function. But i am not sure who is
>> calling the functions
>> NDIS!ndisMLoopbackPacketX and why its being called. When i received the
>> packet, i tried to send it using NdisSend, i am not sure why
>> ndisMLoopbackPacketX is being called. Here is the fragment of my code.
>> NdisSend(&Status,pBridgeAdapt->BindingHandle,MyPacket);
>>
>> if (Status != NDIS_STATUS_PENDING){
>>
>> ////Here we have to free all the buffer and memory..// Packet this is my
>> packet i have to work on Packet
>>
>> FltCleanPacket(MyPacket);
>>
>> NdisDprFreePacket(MyPacket);
>>
>> }
>>
>> //
>>
>> // We will have to block the original packet here
>>
>> //
>>
>> Status = NDIS_STATUS_SUCCESS;
>>
>> return Status;
>>
>> As i undestand from the stack trace, I received the pacekts in PtReceive.
>> and i send it using NdisSend. But i do not understand the significance of
>> these functions. Why these are being called.
>>
>> f78ac854 bad6c400 899db138 f78ac874 00000001
>> NDIS!ethFilterDprIndicateReceivePacket+0x4a4
>> f78ac87c bad36f0a 899db138 0002f9e8 c000009a
>> NDIS!ndisMLoopbackPacketX+0x1d0
>> f78ac898 bad71a29 8902f980 8902f9e8 f78ac8e4 NDIS!ndisMSendX+0x174
>>
>> This issue came up, when i ran etherreal. Is ethereal doing something.
>> Everything was working normally before that.
>>
>> What is triple fault and how can i trace it? Sorry these are newbie
>> questions.
>>
>>
>>
>> "Calvin Guan" <hguan@xxxxxxxxxxxxxxxxxxx> wrote in message
>> news:O2o%23L5RmFHA.3120@xxxxxxxxxxxxxxxxxxxxxxx
>>> From your attached bugcheck dump, obviously, your code did bad recursion
>>> and exhausted the stack.
>>>
>>>> So my code works fine most of time, but sometimes system just reboots
>>>> without any blue screen and it does not generate crash DUMP either.
>>>
>>> Sounds like a triple fault to me.
>>>
>>> --
>>> Calvin Guan (Windows DDK MVP)
>>> Staff SW Engineer NetXtreme Longhorn MINIPORT
>>> Broadcom Corp. Irvine, CA
>>> www.broadcom.com
>>>
>>
>>
>


.



Relevant Pages

  • Re: Actius MM10 modem
    ... telling me that "pppd exited with return value ... call retry delay timer expires) without waiting for an outbound packet. ... Shut down the link when idle-time seconds pass without receiving or ... The environment variable PPPHOME, if present, specifies the directory in ...
    (comp.os.linux.portable)
  • Re: Determining if it is "safe" to send UDP packets
    ... for receiving Udp data. ... I'm receiving from a camera lines of data at 55 Hz. ... the next packet hits the wire. ... Another problem with TCP is its assumption that a lost packet is due to ...
    (microsoft.public.win32.programmer.kernel)
  • Re: OutOfMemoryException from Thread.Start
    ... I guess that what I'm saying is that you're implementing a resend protocol ... > of the fact that the receiving end uses a fixed 2KB buffer to receive ... >>> stream of bytes (packet) first and then sends it by calling the Socket ... >>> the client connects, the server accepts it and waits. ...
    (microsoft.public.windowsce.app.development)
  • Re: OutOfMemoryException from Thread.Start
    ... the receive process may receive an ACK and a DATA structure at ... >> stream of bytes (packet) first and then sends it by calling the Socket ... >> - On receiving, bytes are received asynchronously by calling the Socket ... >> the client connects, the server accepts it and waits. ...
    (microsoft.public.windowsce.app.development)
  • Re: OutOfMemoryException from Thread.Start
    ... > stream of bytes (packet) first and then sends it by calling the Socket ... > - On receiving, bytes are received asynchronously by calling the Socket ... > the client connects, the server accepts it and waits. ...
    (microsoft.public.windowsce.app.development)