From owner-freebsd-net Wed Oct 10 18:15: 7 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id BCE3737B405 for ; Wed, 10 Oct 2001 18:15:05 -0700 (PDT) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id SAA14151; Wed, 10 Oct 2001 18:06:22 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.3/8.11.3) id f9B16L514629; Wed, 10 Oct 2001 18:06:21 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200110110106.f9B16L514629@arch20m.dellroad.org> Subject: Re: Trying to find out which interface an IP packet is coming from in ip_output() routine In-Reply-To: <200110101618.f9AGIVA86599@vashon.polstra.com> "from John Polstra at Oct 10, 2001 09:18:31 am" To: John Polstra Date: Wed, 10 Oct 2001 18:06:21 -0700 (PDT) Cc: net@FreeBSD.ORG, aihguo1@hotmail.com X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Polstra writes: > > Can anybody help me find a way to find out which interface an IP > > packet is coming from in ip_output()/ip_input() routine? > > The mb->m_pkthdr.rcvif field of the mbuf points to the interface on > which the packet was received. ...if any. In ip_input(), mb->m_pkthdr.rcvif is always non-NULL, but in ip_output() it may be NULL e.g. if the packet was locally generated. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message