cvs commit: src/sys/netinet in_gif.c

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Mon Jun 20 12:15:11 GMT 2005


On Mon, 20 Jun 2005, Hajimu UMEMOTO wrote:

Hi,

> >>>>> On Mon, 20 Jun 2005 08:39:30 +0000 (UTC)
> >>>>> "Bjoern A. Zeeb" <bz at 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


More information about the cvs-src mailing list