Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jun 2005 12:10:40 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Hajimu UMEMOTO <ume@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, "Bjoern A. Zeeb" <bz@FreeBSD.org>, cvs-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netinet in_gif.c
Message-ID:  <Pine.BSF.4.53.0506201207500.69832@e0-0.zab2.int.zabbadoz.net>
In-Reply-To: <ygebr61s36m.wl%ume@mahoroba.org>
References:  <200506200839.j5K8dUFm009042@repoman.freebsd.org> <ygebr61s36m.wl%ume@mahoroba.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 20 Jun 2005, Hajimu UMEMOTO wrote:

Hi,

> >>>>> On Mon, 20 Jun 2005 08:39:30 +0000 (UTC)
> >>>>> "Bjoern A. Zeeb" <bz@FreeBSD.org> said:
>
> bz>   Modified files:
> bz>     sys/netinet          in_gif.c
> bz>   Log:
> bz>   Fix IP(v6) over IP tunneling most likely broken with ifnet changes.
>
> Thanks!  I suffered this issue.
> It seems there is same issue in in6_gif.c as well.

I cannot test it but it looks the same.

If this works for you either commit it yourself w/ re@ approval or let
me know.

http://sources.zabbadoz.net/freebsd/patchset/sys-netinet6-in6_gif.c.diff

Index: in6_gif.c
===================================================================
RCS file: /local/mirror/FreeBSD/r/ncvs/src/sys/netinet6/in6_gif.c,v
retrieving revision 1.21
diff -u -p -r1.21 in6_gif.c
--- in6_gif.c	10 Jun 2005 16:49:22 -0000	1.21
+++ in6_gif.c	20 Jun 2005 11:57:44 -0000
@@ -234,13 +234,21 @@ in6_gif_input(mp, offp, proto)
 {
 	struct mbuf *m = *mp;
 	struct ifnet *gifp = NULL;
+	struct gif_softc *sc;
 	struct ip6_hdr *ip6;
 	int af = 0;
 	u_int32_t otos;

 	ip6 = mtod(m, struct ip6_hdr *);

-	gifp = (struct ifnet *)encap_getarg(m);
+	sc = (struct gif_softc *)encap_getarg(m);
+	if (sc == NULL) {
+		m_freem(m);
+		ipstat.ips_nogif++;
+		return;
+	}
+
+	gifp = GIF2IFP(sc);

 	if (gifp == NULL || (gifp->if_flags & IFF_UP) == 0) {
 		m_freem(m);

-- 
Bjoern A. Zeeb				bzeeb at Zabbadoz dot NeT



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