dummy ethernet driver

Dave Airlie (airlied@linux.ie)
Mon, 6 Jan 2003 05:57:20 +0000 (GMT)


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-30062-1041832713-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,
I have a VAX simulator running on my PC which uses pcap to send/recv
packets, however these packets are never seen on the local machine when
using a real ethernet device (everyone else on the network sees them), now
I only really want the local machine to see them not the network so I
decided I might get away with using loopback, however the simulator
configures its own IP and loopback isn't useful for this as the sim starts
arping and we don't do any arp on loopback.

so I turned to the dummy device but it isn't really a dummy Ethernet
device but rather a useless one :-), so I patched the dummy so it had an
address (hardcoded) is broadcast and loops back packets to itself...

the patch is attached.. is there any reason why the dummy device doesn't
want to do this stuff? I'm just submitting the patch as a request for
comments on why this isn't done anyway in the dummy?

Dave.

-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied@skynet.ie
pam_smb / Linux DecStation / Linux VAX / ILUG person

--=_courier-30062-1041832713-0001-2 Content-Type: text/plain; charset=us-ascii; name="dummy_diff" Content-Transfer-Encoding: base64 Content-ID: <Pine.LNX.4.44.0301060557200.24333@skynet> Content-Description: Content-Disposition: attachment; filename=dummy_diff

LS0tIC91c3Ivc3JjL2xpbnV4L2RyaXZlcnMvbmV0L2R1bW15LmMJMjAwMS0x MC0wMSAwNToyNjowNi4wMDAwMDAwMDAgKzEwMDANCisrKyAuL2R1bW15LmMJ MjAwMy0wMS0wNiAxNzowNjo0NC4wMDAwMDAwMDAgKzExMDANCkBAIC0zNSw2 ICszNSw3IEBADQogI2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPg0KICNpbmNs dWRlIDxsaW51eC9uZXRkZXZpY2UuaD4NCiAjaW5jbHVkZSA8bGludXgvaW5p dC5oPg0KKyNpbmNsdWRlIDxsaW51eC9ldGhlcmRldmljZS5oPg0KIA0KIHN0 YXRpYyBpbnQgZHVtbXlfeG1pdChzdHJ1Y3Q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