Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jul 2001 18:44:18 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        net@freebsd.org
Subject:   error in ip_checkinterface code?
Message-ID:  <20010723184418.B28097@Odin.AC.HMC.Edu>

next in thread | raw e-mail | index | archive | help

--Pd0ReVV5GZGQvF3a
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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 =3D ip_checkinterface && (ipforwarding =3D=3D 0) &&=20
+	    m->m_pkthdr.rcvif !=3D NULL &&
 	    ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) =3D=3D 0) &&
 	    (ip_fw_fwd_addr =3D=3D NULL);
=20
--=20
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

--Pd0ReVV5GZGQvF3a
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7XNLxXY6L6fI4GtQRAkiKAJsG0TyhrWZFKM5uhlwMHrzDmLw9+wCfW1Fx
4C4cU24YZsxwCVU9VEuLwOo=
=Vsxn
-----END PGP SIGNATURE-----

--Pd0ReVV5GZGQvF3a--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010723184418.B28097>