From owner-freebsd-net Tue Jul 24 16: 0:12 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id 518D537B403 for ; Tue, 24 Jul 2001 15:59:57 -0700 (PDT) (envelope-from julian@elischer.org) Received: from elischer.org (InterJet.elischer.org [192.168.1.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id WAA19967; Mon, 23 Jul 2001 22:10:34 -0700 (PDT) Message-ID: <3B5CE50D.D57F5E72@elischer.org> Date: Mon, 23 Jul 2001 20:01:33 -0700 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Brooks Davis Cc: net@freebsd.org Subject: Re: error in ip_checkinterface code? References: <20010723184418.B28097@Odin.AC.HMC.Edu> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit 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 Brooks Davis wrote: > > I just ran into what appears to be a bug in the ip_checkinterface code. > The problem is that is assumes m->m_pkthdr.rcvif is non-NULL. > Apparently this is normally true, but I have some netgraph code that > processes it's processes in such a way that they lose their interface > pointer which means that when I stick them back into the ip_stack get a > panic. A quick patch that fixes the problem is included below. Is > this fix correct? > > -- Brooks > > Index: ip_input.c > =================================================================== > RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v > retrieving revision 1.174 > diff -u -r1.174 ip_input.c > --- ip_input.c 2001/06/23 17:17:58 1.174 > +++ ip_input.c 2001/07/24 01:46:22 > @@ -559,6 +559,7 @@ > * the packets are received. > */ > checkif = ip_checkinterface && (ipforwarding == 0) && > + m->m_pkthdr.rcvif != NULL && > ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) && > (ip_fw_fwd_addr == NULL); another possibility is to assign an incoming interface to the reinjected packet :-) (what are you using netgraph for?) > > -- > Any statement of the form "X is the one, true Y" is FALSE. > PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 > > -------------------------------------------------------------------------------- > Part 1.2Type: application/pgp-signature -- +------------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ julian@elischer.org +------>x USA \ a very strange | ( OZ ) \___ ___ | country ! +- X_.---._/ presently in San Francisco \_/ \\ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message