netdev
[Top] [All Lists]

Re: af_packet bug?

To: netdev@xxxxxxxxxxx
Subject: Re: af_packet bug?
From: Lars Brinkhoff <lars.spam@xxxxxxxxxx>
Date: 02 Nov 2001 09:26:36 +0100
In-reply-to: <20011030164411.A10318@xxxxxxxxxxxxx>
Organization: nocrew
References: <200110291843.VAA01641@xxxxxxxxxxxxx> <85lmht1sri.fsf@xxxxxxxxxxxxxxx> <20011030164411.A10318@xxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
I wrote:
> > The emulated machine communicates with other network hosts by sending
> > ethernet packets using af_packet.  But since this doesn't work for
> > talking to the host machine the emulator is running on, the emulator
> > must strip off the ethernet header and send those packets to the
> > loopback device.  Does that sound like a plausible solution?

Andi Kleen <ak@xxxxxxx> writes:
> The tun and/or ethertap devices have been exactly designed to make such
> things possible.

kuznet@xxxxxxxxxxxxx writes:
> I guess you want ethertap.

Michael Richardson <mcr@xxxxxxxxxxxxxxxxxxxxxx> writes:
> Or, use ethertap0, and use bridging on the host to get onto the real
> wire. That will solve all the problems with host communications.

Thank you.

Since af_packet is almost the right thing, could the TAP device be
used just to inject packets into the host TCP/IP stack?  The emulator
sends packets to the network with af_packet as usual, except when
sending packets to the hosting machine.  In that case, the packet is
written to the TAP device.  Linux would see this as a packet coming
from the tap0 interface, right?

To send packets from Linux to the emulator, the ARP table could be
manipulated to indicate that the IP address of the emulator is on the
network connected to tap0.  The emulator would read those packets off
the TAP device.

-- 
Lars Brinkhoff          http://lars.nocrew.org/     Linux, GCC, PDP-10
Brinkhoff Consulting    http://www.brinkhoff.se/    programming

<Prev in Thread] Current Thread [Next in Thread>
  • Re: af_packet bug?, Lars Brinkhoff <=