Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2007 13:36:43 +1000
From:      Alan Garfield <alan@fromorbit.com>
To:        freebsd-net@freebsd.org
Subject:   fake MAC addresses and ARP
Message-ID:  <1176781003.6367.12.camel@hiro.auspc.com.au>

next in thread | raw e-mail | index | archive | help
Hi all,

I've got a small problem I'm hoping one of you highly skilled
individuals might have the answer to.

I've got a little driver that communicates via a small buffer on the
motherboard of a Sun Fire V20z to a built-in "service processor" which
is running Linux. The driver on both sides makes the buffer look like a
Ethernet interface.

Now I've ported the Linux driver across to FreeBSD so far without to
much trouble, but now I've hit the limits of my knowledge. 

The driver can receive data from the SP just fine, I can tcpdump the
interface and I get all the traffic no problem. But when I attempt to
send anything I get :-

arplookup 169.254.101.2 failed: could not allocate llinfo
arpresolve: can't allocate route for 169.254.101.2

The Linux driver I'm porting simply grabbed any outgoing arp requests,
made up an appropriate response with the pre-defined fake MAC's, put it
into the input queue and ate the request packet.

Now in FreeBSD I cannot see a way to do this other than overriding the
if_output function in the ifp with something of my own. I've tried to do
it in if_start but I never see any arp requests. But I also think the
whole thing is a bit of an ugly hack.

Now I'm thinking I have to do something with rtrequest instead, but I
have no idea what I am required to do in that function to insert the
fake MACs to resolve the route. I get a call for RTM_ADD but then I
don't know what I'm suppose to do. There is no similar device drivers I
can gauge what to do (except the plip driver which doesn't seem to worry
about arp at all!).

Any help would be most appreciated as I'm almost done and I'm running
out of spare time to get this working!

Many thanks,

Alan.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1176781003.6367.12.camel>