DragonFly BSD
DragonFly submit List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

sys/netinet6/ip6_input.c: fix endianess bug


From: Hiroki Sato <hrs@xxxxxxxxxx>
Date: Sat, 01 Jan 2005 08:20:06 +0900 (JST)

Hi,

 A patch to fix a bug in fragment header handling is attached.

Fix wrong byte-order conversion on fragment header scanning.

References:	KAME: kame/sys/netinet6/ip6_input.c 1.331
		FreeBSD: sys/netinet6/ip6_input.c 1.54

Index: ip6_input.c
===================================================================
RCS file: /cvs/src/sys/netinet6/ip6_input.c,v
retrieving revision 1.22
diff -d -u -I\$FreeBSD:.*\$ -I\$NetBSD:.*\$ -I\$OpenBSD:.*\$ -I\$DragonFly:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.22 ip6_input.c
--- ip6_input.c	21 Dec 2004 02:54:47 -0000	1.22
+++ ip6_input.c	31 Dec 2004 02:47:02 -0000
@@ -1499,7 +1499,7 @@
 		if (m->m_pkthdr.len < off + sizeof(fh))
 			return -1;
 		m_copydata(m, off, sizeof(fh), (caddr_t)&fh);
-		if ((ntohs(fh.ip6f_offlg) & IP6F_OFF_MASK) != 0)
+		if ((fh.ip6f_offlg & IP6F_OFF_MASK) != 0)
 			return -1;
 		if (nxtp)
 			*nxtp = fh.ip6f_nxt;

Attachment: pgp00000.pgp
Description: PGP signature



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]