2003-01-06 05:48:44

by Dave Airlie

[permalink] [raw]
Subject: dummy ethernet driver


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 / [email protected]
pam_smb / Linux DecStation / Linux VAX / ILUG person


Attachments:
dummy_diff (1.73 kB)

2003-01-06 10:08:22

by Nick Holloway

[permalink] [raw]
Subject: Re: dummy ethernet driver

[email protected] (Dave Airlie) writes:
> 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?

[Some background on the dummy driver -- I don't know if there is another
way to configure devices for your purpose, or if your patch is the only
way, I'll leave that for others to answer]

With the way the dummy driver was used, it wasn't necessary to handle
packets.

I wanted my dial-up static IP address to be valid even when the ppp device
was not connected, so I wrote the dummy interface. If the destination
IP of a packet matches the IP of a local interface, then the packet is
routed over the loopback interface.

So, for this use the dummy interface doesn't need to handle packets, it
just needs to hold an IP address. In the case that someone configures
the routing tables so that packets are sent via the dummy device, it
just black-holes the packets.

--
`O O' | [email protected]
// ^ \\ | http://www.pyrites.org.uk/

2003-01-06 14:01:19

by Alan

[permalink] [raw]
Subject: Re: dummy ethernet driver

On Mon, 2003-01-06 at 05:57, Dave Airlie wrote:
> 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

If you want to talk to local systems why don't you use the netlink
interface/ethertap stuff ?

2003-01-06 22:25:00

by Dave Airlie

[permalink] [raw]
Subject: Re: dummy ethernet driver


> On Mon, 2003-01-06 at 05:57, Dave Airlie wrote:
> > 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
>
> If you want to talk to local systems why don't you use the netlink
> interface/ethertap stuff ?

because I'm unconscionably lazy, and the VAX simulator code is already
written to use pcap and I'd rather not rewrite it, why fix something when
a quick hack will suffice :-)

my long term plan is too ethertap the simulator alright.. but moving along
the Linux/VAX project is primary, fixing simulator isn't :-)

I'm just wondering why dummy just do that bit more.. design decision? or
nobodys ever bothered?

Dave.

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


2003-01-07 06:43:16

by Peter Svensson

[permalink] [raw]
Subject: Re: dummy ethernet driver

On Mon, 6 Jan 2003, Dave Airlie wrote:

> > If you want to talk to local systems why don't you use the netlink
> > interface/ethertap stuff ?
>
> because I'm unconscionably lazy, and the VAX simulator code is already
> written to use pcap and I'd rather not rewrite it, why fix something when
> a quick hack will suffice :-)

Just as an aside, the ts10 vax emulator uses the tap driver. Combined with
the kernel bridging code you can create all kinds of network
configurations.

The last time i looked at simh Bob Supnik mentioned that the ethernet
simulation layer was to be targeted at tap/tun driver among others.

Peter
--
Peter Svensson ! Pgp key available by finger, fingerprint:
<[email protected]> ! 8A E9 20 98 C1 FF 43 E3 07 FD B9 0A 80 72 70 AF
------------------------------------------------------------------------
Remember, Luke, your source will be with you... always...