From owner-freebsd-net@FreeBSD.ORG Mon Oct 6 06:04:55 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 395441065694 for ; Mon, 6 Oct 2008 06:04:55 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outK.internet-mail-service.net (outk.internet-mail-service.net [216.240.47.234]) by mx1.freebsd.org (Postfix) with ESMTP id 21FED8FC18 for ; Mon, 6 Oct 2008 06:04:54 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id BD2902478; Sun, 5 Oct 2008 23:04:54 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 80DD32D6017; Sun, 5 Oct 2008 23:04:53 -0700 (PDT) Message-ID: <48E9AA84.90804@elischer.org> Date: Mon, 06 Oct 2008 14:04:52 +0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.17 (Macintosh/20080914) MIME-Version: 1.0 To: Ryan French References: <200810061730.23641.rfrench@freebsd.org> In-Reply-To: <200810061730.23641.rfrench@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: 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 06:04:55 -0000 Ryan French wrote: > 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 > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" You could create a tag type that holds a layer 2 address, and attach it to the packet on ingresss, it should stay with the packet as long as it's not destroyed.. then on egress you could find it and use it..