Subject: Re: kern/30082
To: None <darrenr@netbsd.org, gnats-admin@netbsd.org,>
From: Darren Reed <darrenr@netbsd.org>
List: netbsd-bugs
Date: 06/11/2005 11:28:02
The following reply was made to PR kern/30082; it has been noted by GNATS.

From: darrenr@netbsd.org (Darren Reed)
To: pc@eila.jussieu.fr
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/30082
Date: Sat, 11 Jun 2005 11:27:51 +0000 (UTC)

 I've just commited a patch to netbsd that should go some way to reducing
 or eliminating this problems.  I've attached the patches below for you to
 try.
 
 Darren
 Index: fil.c
 ===================================================================
 RCS file: /devel/CVS/IP-Filter/fil.c,v
 retrieving revision 2.243.2.58
 diff -c -r2.243.2.58 fil.c
 *** fil.c	10 May 2005 21:13:30 -0000	2.243.2.58
 --- fil.c	11 Jun 2005 05:22:17 -0000
 ***************
 *** 2184,2189 ****
 --- 2184,2190 ----
   #ifdef USE_INET6
   	ip6_t *ip6;
   #endif
 + 	SPL_INT(s);
   
   	/*
   	 * The first part of fr_check() deals with making sure that what goes
 ***************
 *** 2264,2269 ****
 --- 2265,2272 ----
   
   	fin->fin_ipoff = (char *)ip - MTOD(m, char *);
   
 + 	SPL_NET(s);
 + 
   #ifdef	USE_INET6
   	if (v == 6) {
   		ATOMIC_INCL(frstats[out].fr_ipv6);
 ***************
 *** 2492,2498 ****
 --- 2495,2503 ----
   #endif
   	}
   
 + 	SPL_X(s);
   	RWLOCK_EXIT(&ipf_global);
 + 
   #ifdef _KERNEL
   # if OpenBSD >= 200311    
   	if (FR_ISPASS(pass) && (v == 4)) {
 Index: ip_compat.h
 ===================================================================
 RCS file: /devel/CVS/IP-Filter/ip_compat.h,v
 retrieving revision 2.142.2.25
 diff -c -r2.142.2.25 ip_compat.h
 *** ip_compat.h	28 Mar 2005 09:33:36 -0000	2.142.2.25
 --- ip_compat.h	10 Jun 2005 18:41:35 -0000
 ***************
 *** 1375,1380 ****
 --- 1375,1386 ----
   
   #endif
   
 + #if defined(USE_SPL) && defined(_KERNEL)
 + # define	SPL_INT(x)	int x
 + #else
 + # define	SPL_INT(x)
 + #endif
 + 
   #define	MAX_IPV4HDR	((0xf << 2) + sizeof(struct icmp) + sizeof(ip_t) + 8)
   
   #ifndef	IP_OFFMASK