From nobody@FreeBSD.org  Thu Mar  3 14:44:10 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9533D106579E
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  3 Mar 2011 14:44:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B3EC8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  3 Mar 2011 14:44:10 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p23Ei917010230
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 3 Mar 2011 14:44:09 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p23Ei9PK010226;
	Thu, 3 Mar 2011 14:44:09 GMT
	(envelope-from nobody)
Message-Id: <201103031444.p23Ei9PK010226@red.freebsd.org>
Date: Thu, 3 Mar 2011 14:44:09 GMT
From: Dmitry Afanasiev <KOT@MATPOCKuH.Ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: netflow.c does not compile with disabled INET6
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         155227
>Category:       kern
>Synopsis:       netflow.c does not compile with disabled INET6
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bz
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 03 14:50:09 UTC 2011
>Closed-Date:    Thu Mar 03 16:51:29 UTC 2011
>Last-Modified:  Thu Mar 03 16:51:29 UTC 2011
>Originator:     Dmitry Afanasiev
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD orion 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Wed Mar  2 12:54:04 MSK 2011     root@orion:/usr/obj/usr/src/sys/orion  amd64

>Description:
sys/netgraph/netflow/netflow.c does not compile with disabled INET6:
mno-sse -mno-sse2 -mno-sse3  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -std=iso9899:1999 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c /usr/src/sys/modules/netgraph/netflow/../../../netgraph/netflow/netflow.c
/usr/src/sys/modules/netgraph/netflow/../../../netgraph/netflow/netflow.c: In function 'expire_flow':
/usr/src/sys/modules/netgraph/netflow/../../../netgraph/netflow/netflow.c:286: error: 'struct netflow' has no member named 'zone6'
/usr/src/sys/modules/netgraph/netflow/../../../netgraph/netflow/netflow.c:301: error: 'struct netflow' has no member named 'zone6'
*** Error code 1
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error

>How-To-Repeat:
1. Update to r219182
2. Disable INET6
3. Build kernel
>Fix:


Patch attached with submission follows:

--- netflow.c.orig	2011-03-03 16:36:00.895086339 +0300
+++ netflow.c	2011-03-03 16:37:32.335079030 +0300
@@ -282,8 +282,10 @@
 			atomic_add_32(&priv->info.nfinfo_export9_failed, 1);
 			if (version == IPVERSION)
 				uma_zfree_arg(priv->zone, fle, priv);
+#ifdef INET6
 			else if (version == IP6VERSION)
 				uma_zfree_arg(priv->zone6, fle, priv);
+#endif
 			else
 				panic("ng_netflow: Unknown IP proto: %d", version);
 			return;
@@ -297,8 +299,10 @@
 
 	if (version == IPVERSION)
 		uma_zfree_arg(priv->zone, fle, priv);
+#ifdef INET6
 	else if (version == IP6VERSION)
 		uma_zfree_arg(priv->zone6, fle, priv);
+#endif
 }
 
 /* Get a snapshot of node statistics */


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bz 
Responsible-Changed-By: bz 
Responsible-Changed-When: Thu Mar 3 15:02:13 UTC 2011 
Responsible-Changed-Why:  
I noticed last night and am waiting for compiles to finish to commit 
the fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155227 

From: Dmitry Afanasiev <KOT@MATPOCKuH.Ru>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/155227: netflow.c does not compile with disabled INET6
Date: Thu, 03 Mar 2011 18:08:02 +0300

 This is a multi-part message in MIME format.
 --------------080701020505080503060906
 Content-Type: text/plain; charset=KOI8-R; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I'm sorry, correct patch is attached.
 
 --------------080701020505080503060906
 Content-Type: text/plain;
  name="netflow.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="netflow.txt"
 
 --- netflow.c.orig	2011-03-03 16:36:00.895086339 +0300
 +++ netflow.c	2011-03-03 17:57:18.444093627 +0300
 @@ -99,7 +99,9 @@
  static int export_send(priv_p, fib_export_p, item_p, int);
  
  static int hash_insert(priv_p, struct flow_hash_entry *, struct flow_rec *, int, uint8_t);
 +#ifdef INET6
  static int hash6_insert(priv_p, struct flow6_hash_entry *, struct flow6_rec *, int, uint8_t);
 +#endif
  
  static __inline void expire_flow(priv_p, fib_export_p, struct flow_entry *, int);
  
 @@ -282,8 +284,10 @@
  			atomic_add_32(&priv->info.nfinfo_export9_failed, 1);
  			if (version == IPVERSION)
  				uma_zfree_arg(priv->zone, fle, priv);
 +#ifdef INET6
  			else if (version == IP6VERSION)
  				uma_zfree_arg(priv->zone6, fle, priv);
 +#endif
  			else
  				panic("ng_netflow: Unknown IP proto: %d", version);
  			return;
 @@ -297,8 +301,10 @@
  
  	if (version == IPVERSION)
  		uma_zfree_arg(priv->zone, fle, priv);
 +#ifdef INET6
  	else if (version == IP6VERSION)
  		uma_zfree_arg(priv->zone6, fle, priv);
 +#endif
  }
  
  /* Get a snapshot of node statistics */
 
 --------------080701020505080503060906--

From: Dmitry Afanasiev <KOT@MATPOCKuH.Ru>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/155227: netflow.c does not compile with disabled INET6
Date: Thu, 03 Mar 2011 18:55:10 +0300

 This is a multi-part message in MIME format.
 --------------050600090200070309060609
 Content-Type: text/plain; charset=KOI8-R; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Also netflow_v9.c must be patched.
 
 --------------050600090200070309060609
 Content-Type: text/plain;
  name="netflow_v9.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="netflow_v9.txt"
 
 --- netflow_v9.c.orig	2011-03-03 18:12:22.988078703 +0300
 +++ netflow_v9.c	2011-03-03 18:14:21.482093023 +0300
 @@ -256,7 +256,9 @@
  
  	/* Prepare flow record */
  	fed = (struct flow_entry_data *)&fle->f;
 +#ifdef INET6
  	fed6 = (struct flow6_entry_data *)&fle->f;
 +#endif
  	/* We can use flow_type field since fle6 offset is equal to fle */
  	flow_type = fed->r.flow_type;
  
 
 --------------050600090200070309060609--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/155227: commit references a PR
Date: Thu,  3 Mar 2011 16:17:08 +0000 (UTC)

 Author: bz
 Date: Thu Mar  3 16:16:49 2011
 New Revision: 219229
 URL: http://svn.freebsd.org/changeset/base/219229
 
 Log:
   Unbreak the build for no options INET6.
   
   PR:		kern/155227
   Submitted by:	Dmitry Afanasiev (KOT MATPOCKuH.Ru)
 
 Modified:
   head/sys/netgraph/netflow/netflow.c
   head/sys/netgraph/netflow/netflow_v9.c
 
 Modified: head/sys/netgraph/netflow/netflow.c
 ==============================================================================
 --- head/sys/netgraph/netflow/netflow.c	Thu Mar  3 15:27:06 2011	(r219228)
 +++ head/sys/netgraph/netflow/netflow.c	Thu Mar  3 16:16:49 2011	(r219229)
 @@ -99,7 +99,9 @@ static int export_add(item_p, struct flo
  static int export_send(priv_p, fib_export_p, item_p, int);
  
  static int hash_insert(priv_p, struct flow_hash_entry *, struct flow_rec *, int, uint8_t);
 +#ifdef INET6
  static int hash6_insert(priv_p, struct flow6_hash_entry *, struct flow6_rec *, int, uint8_t);
 +#endif
  
  static __inline void expire_flow(priv_p, fib_export_p, struct flow_entry *, int);
  
 @@ -282,8 +284,10 @@ expire_flow(priv_p priv, fib_export_p fe
  			atomic_add_32(&priv->info.nfinfo_export9_failed, 1);
  			if (version == IPVERSION)
  				uma_zfree_arg(priv->zone, fle, priv);
 +#ifdef INET6
  			else if (version == IP6VERSION)
  				uma_zfree_arg(priv->zone6, fle, priv);
 +#endif
  			else
  				panic("ng_netflow: Unknown IP proto: %d", version);
  			return;
 @@ -297,8 +301,10 @@ expire_flow(priv_p priv, fib_export_p fe
  
  	if (version == IPVERSION)
  		uma_zfree_arg(priv->zone, fle, priv);
 +#ifdef INET6
  	else if (version == IP6VERSION)
  		uma_zfree_arg(priv->zone6, fle, priv);
 +#endif
  }
  
  /* Get a snapshot of node statistics */
 
 Modified: head/sys/netgraph/netflow/netflow_v9.c
 ==============================================================================
 --- head/sys/netgraph/netflow/netflow_v9.c	Thu Mar  3 15:27:06 2011	(r219228)
 +++ head/sys/netgraph/netflow/netflow_v9.c	Thu Mar  3 16:16:49 2011	(r219229)
 @@ -256,7 +256,9 @@ export9_add(item_p item, struct netflow_
  
  	/* Prepare flow record */
  	fed = (struct flow_entry_data *)&fle->f;
 +#ifdef INET6
  	fed6 = (struct flow6_entry_data *)&fle->f;
 +#endif
  	/* We can use flow_type field since fle6 offset is equal to fle */
  	flow_type = fed->r.flow_type;
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: bz 
State-Changed-When: Thu Mar 3 16:50:58 UTC 2011 
State-Changed-Why:  
Patch(es) committed.  Thanks for sending. 

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