From owner-freebsd-net@FreeBSD.ORG Tue Apr 17 03:55:12 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3023C16A402 for ; Tue, 17 Apr 2007 03:55:12 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from thing1.auspcmarket.com.au (mail.fromorbit.com [203.31.169.65]) by mx1.freebsd.org (Postfix) with ESMTP id DBCFA13C46A for ; Tue, 17 Apr 2007 03:55:11 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from [192.168.1.99] (unknown [192.168.1.99]) by thing1.auspcmarket.com.au (Postfix) with ESMTP id 67CF15C19 for ; Tue, 17 Apr 2007 13:36:43 +1000 (EST) From: Alan Garfield To: freebsd-net@freebsd.org Content-Type: text/plain Date: Tue, 17 Apr 2007 13:36:43 +1000 Message-Id: <1176781003.6367.12.camel@hiro.auspc.com.au> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Subject: fake MAC addresses and ARP X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2007 03:55:12 -0000 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.