From owner-freebsd-net@FreeBSD.ORG Mon Oct 6 04:51:39 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7C511065688 for ; Mon, 6 Oct 2008 04:51:39 +0000 (UTC) (envelope-from rfrench@freebsd.org) Received: from titania.wxnz.net (titania.wxnz.net [58.28.4.13]) by mx1.freebsd.org (Postfix) with ESMTP id 6B8298FC0C for ; Mon, 6 Oct 2008 04:51:39 +0000 (UTC) (envelope-from rfrench@freebsd.org) Received: from mini-tank.local (ip-118-90-41-173.xdsl.xnet.co.nz [118.90.41.173]) by titania.wxnz.net (Postfix) with ESMTP id 193B51DB803C for ; Mon, 6 Oct 2008 17:30:24 +1300 (NZDT) From: Ryan French To: freebsd-net@freebsd.org Date: Mon, 6 Oct 2008 17:30:23 +1300 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200810061730.23641.rfrench@freebsd.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Getting packets MAC source address in if_ethersubr.c 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: Mon, 06 Oct 2008 04:51:39 -0000 Hi All, For my implementation of MPLS I have just about run out of time for my dissertation so at the moment I am trying to create fake routing table entries e.t.c. rather than doing this properly (I will be doing this once uni is finished and I have more free time to work on it). I now have receiving, decoding and sending of packets working, except for one small problem. When I send a packet back out the MAC address is wrong. I am looking for a way in the ether_output function in if_ethersubr.c that I can get the MAC address of the source of the packet and then just send it back to that source. If anyone knows how to do this without having to use arpresolve or anything like that (the IP address of the destination is not going to be the same as the IP destination in the packet) or without having to setup a proper routing table then it would be much appreciated. Thanks, -Ryan