[Winpcap-users] pcap_sendpacket to local adaptor (Sending to the local machine)

Fish" (David B. Trout fish at infidels.org
Wed May 19 23:52:21 PDT 2010


Mark Pizzolato wrote:

[...]
> In general, a host never sends packets on a LAN to itself.

In general.


> NICs are not designed to do that.

Misleading. NICs are designed to send whatever data you want them to send.

Whether the Ethernet packet just so happens to have the NIC's MAC in the
Ethernet packet's destination MAC field or not is immaterial. The NIC should
send whatever data you tell it to send. (That is to say the packet SHOULD
make it "onto the wire. If it doesn't then it's malfunctioning. Buy a new
NIC.)


> Pcap_sendpacket() merely asks the NIC to do what it normally does
> and send the packet out.

Correct. And whatever value is in the target MAC field of the packet being
sent shouldn't matter. The packet should get sent. Period.

<snip remainder>

FWIW, my software[1] successfully does what Kyle is currently having trouble
doing and has been successfully doing it now for many years now (since
WinPCap version 2.x on many different systems around the world each using
many different types and models (brands/manufacturers) of NICs) with
absolutely no problems whatsoever. It works fine.

The only reason I can think of as to why Kyle's efforts are working for him
is *maybe* because maybe the NIC wasn't set to promiscuous mode beforehand.
Not sure if that's a requirement for this technique to work or not, but FWIW
that's the way my software does it.[2]

Hope that helps.

-- 
"Fish" (David B. Trout) 
 fish at softdevlabs.com

[1] http://www.softdevlabs.com/ctciw32

See specifically,
http://www.softdevlabs.com/Hercules/ctci-w32-readme.html#overview

[2] Our product (Hercules, a mainframe emulator
(http://www.hercules-390.org)) runs as a virtual machine on the Windows
host, and needs to be able to exchange packets with it (or any other system
really). My CTCI-W32 software (scheduled to be renamed to CTCI-WIN)
accomplishes this by having WinPCap set the adapter into promiscuous mode
and monitoring for any packet whose destination MAC matches that of the
virtual NIC's (or has the all stations broadcast bit on). If so, the packet
is returned back to the virtual machine (i.e. Hercules) and the guest
operating system (running under Hercules) receives it. Packets that the
guest machine wants to send Hercules pass on to my code which simply does a
WinPCap sendpacket.

And as I said this all works fine and HAS been working fine for many years.




More information about the Winpcap-users mailing list