I don't have all the details in my head right now, but I believe you need to 
tell NDIS to ignore loopback packets. You should be able to do this with the 
PacketSetHWFilter() function call. In this way, outgoing packets will be 
ignored by the instance of the adapter you have open.


Thank you, 
David Barnish

"God does not play dice!"
 -- Albert Einstein

"Not only does God play dice with the Universe - he sometimes casts them where 
they can't be seen."
 -- Stephen Hawking
 

-----Original Message-----
From: Bowers, Rick [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 3:30 PM
To: winpcap-users@winpcap.polito.it
Subject: [WinPcap-users] PROBLEM WITH BUILDING A BRIDGE


I'm trying to use winpcap to build a software bridge using two lan cards
-- but seem to be in an infinite feedback loop.  I open both NIC's using
pcap_open( "rpcap://theDeviceName1", ... ) and "rpcap::/theDeviceName2".
Then I start two threads, each collecting frames on one of the NIC's
using pcap_next_ex().  Immediately after reading a frame, the reading
thread sends the frame out untouched to the other NIC using
pcap_sendpacket().  Unfortunately, as soon as I send a frame on a NIC,
it's immediately read back in and sent out the other NIC (where it's
immediately read back in and sent back out the original NIC).  The frame
ping-pong's back and forth forever generating LOTS of network traffic!

Is there any way to prevent the pcap_next_ex() function from reading
back in a frame just sent with pcap_sendpacket()?

Thanks,
Rick Bowers
Hewlett-Packard Company


======================
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]
======================


================================================================= This is the 
WinPcap users list. It is archived at
 http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

 To unsubscribe use
 mailto: [EMAIL PROTECTED]
=================================================================

Reply via email to