From sbauer@hardrock.sdsmt.edu  Mon Jan 19 06:39:40 1998
Received: from hardrock.sdsmt.edu (hardrock.sdsmt.edu [151.159.9.25])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA02107
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Jan 1998 06:39:39 -0800 (PST)
          (envelope-from sbauer@hardrock.sdsmt.edu)
Received: (from sbauer@localhost)
	by hardrock.sdsmt.edu (8.8.8/8.8.8) id HAA02099;
	Mon, 19 Jan 1998 07:39:35 -0700 (MST)
	(envelope-from sbauer)
Message-Id: <199801191439.HAA02099@hardrock.sdsmt.edu>
Date: Mon, 19 Jan 1998 07:39:35 -0700 (MST)
From: Steve Bauer <sbauer@hardrock.sdsmt.edu>
Reply-To: sbauer@hardrock.sdsmt.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: ip_input.c & ip_output.c problems when trying to use ipfilter
X-Send-Pr-Version: 3.2

>Number:         5522
>Category:       kern
>Synopsis:       [PATCH] ip_input.c & ip_output.c problems when trying to use ipfilter
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 19 06:40:01 PST 1998
>Closed-Date:    Mon Jul 31 14:44:48 PDT 2000
>Last-Modified:  Mon Jul 31 14:46:18 PDT 2000
>Originator:     Steve Bauer
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
South Dakota School of Mines and Technology
>Environment:
	The environment is FreeBSD 3.0-CURRENT that was cvsup'd at 7:15AM MST
(14:15 GMT).  
machine:  Gateway NS 7000
Num cpus: 2
cpu type: Pentium II 300
ram:	64MB
Netcard: Adaptec Cogent Quartet ANA-6944/TX
HD Interface: Adaptec Fast & Wide SCSI built on to motherboard (aic7880)
HD:  IBM DCAS-34330W 4.1 GB
Video: Cirrus Logic GD5430

>Description:
	The problem is that when the options IPFILTER_LKM and IPFILTER_LOG
as specified in the kernel config file and the resulting kernel built.  One
gets the following error message:
ip_input.o: undefined symbol fr_check

After examining the problem with ip_input.c, I also check the other places
that IPFILTER was defined and have found a couple more errors. 

>How-To-Repeat:

	Try to build the kernel with the following options:
	
	options		IPFILTER_LKM
	options		IPFILTER_LOG
>Fix:
	Below are the fixes to ip_input.c and ip.output.c 

*** ip_input.c.orig	Mon Jan 19 07:19:35 1998
--- ip_input.c	Mon Jan 19 07:19:58 1998
***************
*** 147,153 ****
  #endif
  
  #if defined(IPFILTER_LKM) || defined(IPFILTER)
- int fr_check __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
  int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **)) = NULL;
  #endif
  
--- 147,152 ----
***************
*** 341,347 ****
  	 * Check if we want to allow this packet to be processed.
  	 * Consider it to be bad if not.
  	 */
! 	if (fr_check) {
  		struct	mbuf	*m1 = m;
  
  		if ((*fr_checkp)(ip, hlen, m->m_pkthdr.rcvif, 0, &m1) || !m1)
--- 340,346 ----
  	 * Check if we want to allow this packet to be processed.
  	 * Consider it to be bad if not.
  	 */
! 	if (fr_checkp) {
  		struct	mbuf	*m1 = m;
  
  		if ((*fr_checkp)(ip, hlen, m->m_pkthdr.rcvif, 0, &m1) || !m1)


*** ip_output.c.orig	Mon Jan 19 07:16:08 1998
--- ip_output.c	Mon Jan 19 07:16:36 1998
***************
*** 83,89 ****
  
  #if defined(IPFILTER_LKM) || defined(IPFILTER)
  int	ip_optcopy __P((struct ip *, struct ip *));
- extern int fr_check __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
  extern int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
  #else
  static int	ip_optcopy __P((struct ip *, struct ip *));
--- 83,88 ----
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: phk 
State-Changed-When: Thu Apr 30 23:06:50 PDT 1998 
State-Changed-Why:  
awaiting committer 
State-Changed-From-To: suspended->closed 
State-Changed-By: nbm 
State-Changed-When: Mon Jul 31 14:44:48 PDT 2000 
State-Changed-Why:  
We're not using remotely the same methods anymore (kld, not lkm), and 
ipfilter seems to build fine on all recent releases, so this PR can be 
closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=5522 
>Unformatted:
