Mon Jan 21 20:18:35 2013 UTC ()
Pull up following revision(s) (requested by msaitoh in ticket #1840):
	sys/external/bsd/ipf/netinet/ip_fil_netbsd.c: revision 1.4 via patch
Fix off-by-one read error.


(bouyer)
diff -r1.46.8.3 -r1.46.8.4 src/sys/dist/ipf/netinet/ip_fil_netbsd.c

cvs diff -r1.46.8.3 -r1.46.8.4 src/sys/dist/ipf/netinet/Attic/ip_fil_netbsd.c (expand / switch to unified diff)

--- src/sys/dist/ipf/netinet/Attic/ip_fil_netbsd.c 2010/09/12 18:59:01 1.46.8.3
+++ src/sys/dist/ipf/netinet/Attic/ip_fil_netbsd.c 2013/01/21 20:18:35 1.46.8.4
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1/* $NetBSD: ip_fil_netbsd.c,v 1.46.8.3 2010/09/12 18:59:01 snj Exp $ */ 1/* $NetBSD: ip_fil_netbsd.c,v 1.46.8.4 2013/01/21 20:18:35 bouyer Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1993-2003 by Darren Reed. 4 * Copyright (C) 1993-2003 by Darren Reed.
5 * 5 *
6 * See the IPFILTER.LICENCE file for details on licencing. 6 * See the IPFILTER.LICENCE file for details on licencing.
7 */ 7 */
8#if !defined(lint) 8#if !defined(lint)
9#if defined(__NetBSD__) 9#if defined(__NetBSD__)
10#include <sys/cdefs.h> 10#include <sys/cdefs.h>
11__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.46.8.3 2010/09/12 18:59:01 snj Exp $"); 11__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.46.8.4 2013/01/21 20:18:35 bouyer Exp $");
12#else 12#else
13static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed"; 13static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
14static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 2.55.2.59 2008/03/01 23:16:38 darrenr Exp"; 14static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 2.55.2.59 2008/03/01 23:16:38 darrenr Exp";
15#endif 15#endif
16#endif 16#endif
17 17
18#if defined(KERNEL) || defined(_KERNEL) 18#if defined(KERNEL) || defined(_KERNEL)
19# undef KERNEL 19# undef KERNEL
20# undef _KERNEL 20# undef _KERNEL
21# define KERNEL 1 21# define KERNEL 1
22# define _KERNEL 1 22# define _KERNEL 1
23#endif 23#endif
24#include <sys/param.h> 24#include <sys/param.h>
@@ -948,27 +948,27 @@ int dst; @@ -948,27 +948,27 @@ int dst;
948 struct mbuf *m; 948 struct mbuf *m;
949 void *ifp; 949 void *ifp;
950#ifdef USE_INET6 950#ifdef USE_INET6
951 ip6_t *ip6; 951 ip6_t *ip6;
952 struct in6_addr dst6; 952 struct in6_addr dst6;
953#endif 953#endif
954 ip_t *ip, *ip2; 954 ip_t *ip, *ip2;
955 955
956 if ((type < 0) || (type > ICMP_MAXTYPE)) 956 if ((type < 0) || (type > ICMP_MAXTYPE))
957 return -1; 957 return -1;
958 958
959 code = fin->fin_icode; 959 code = fin->fin_icode;
960#ifdef USE_INET6 960#ifdef USE_INET6
961 if ((code < 0) || (code > sizeof(icmptoicmp6unreach)/sizeof(int))) 961 if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int)))
962 return -1; 962 return -1;
963#endif 963#endif
964 964
965 if (fr_checkl4sum(fin) == -1) 965 if (fr_checkl4sum(fin) == -1)
966 return -1; 966 return -1;
967#ifdef MGETHDR 967#ifdef MGETHDR
968 MGETHDR(m, M_DONTWAIT, MT_HEADER); 968 MGETHDR(m, M_DONTWAIT, MT_HEADER);
969#else 969#else
970 MGET(m, M_DONTWAIT, MT_HEADER); 970 MGET(m, M_DONTWAIT, MT_HEADER);
971#endif 971#endif
972 if (m == NULL) 972 if (m == NULL)
973 return -1; 973 return -1;
974 avail = MHLEN; 974 avail = MHLEN;