NetBSD Problem Report #34811

From khym@azeotrope.org  Sat Oct 14 08:34:49 2006
Return-Path: <khym@azeotrope.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 3EA4C63B84D
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 14 Oct 2006 08:34:49 +0000 (UTC)
Message-Id: <20061014065144.341214C853@yerfable.azeotrope.org>
Date: Sat, 14 Oct 2006 01:51:43 -0500 (CDT)
From: khym@azeotrope.org
Reply-To: khym@azeotrope.org
To: gnats-bugs@NetBSD.org
Subject: A few more unused variable fixes
X-Send-Pr-Version: 3.95

>Number:         34811
>Category:       kern
>Synopsis:       A few more unused variable fixes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 14 08:35:01 +0000 2006
>Closed-Date:    Sun Jul 10 23:27:37 +0000 2016
>Last-Modified:  Sun Jul 10 23:27:37 +0000 2016
>Originator:     Dave Huang
>Release:        NetBSD 4.99.3 as of October 13, 2006
>Organization:
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym@azeotrope.org |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 30 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Environment:


Architecture: i386
Machine: i386
>Description:
	i386 kernels fail to build due to unused variable errors with
certain kernel configurations:

If MROUTING is enabled, but DIAGNOSTIC is not, proto is unused in
netinet/ip_mroute.c

If IPSEC is enabled, but IPSEC_NAT_T is not, sport and dport are
unused in netkey/key.c

>How-To-Repeat:
	Try to compile an i386 kernel with MROUTING and IPSEC, but no
DIAGNOSTIC or IPSEC_NAT_T.
>Fix:
Index: ip_mroute.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/ip_mroute.c,v
retrieving revision 1.99
diff -u -r1.99 ip_mroute.c
--- ip_mroute.c	12 Oct 2006 01:32:38 -0000	1.99
+++ ip_mroute.c	14 Oct 2006 06:45:51 -0000
@@ -2008,6 +2008,8 @@
 #ifdef DIAGNOSTIC
 	if (!arg || proto != IPPROTO_IPV4)
 		panic("unexpected arg in vif_encapcheck");
+#else
+	do { if (&proto) {} } while (/* CONSTCOND */ 0);
 #endif

 	/*
Index: key.c
===================================================================
RCS file: /cvsroot/src/sys/netkey/key.c,v
retrieving revision 1.143
diff -u -r1.143 key.c
--- key.c	12 Oct 2006 01:32:46 -0000	1.143
+++ key.c	14 Oct 2006 06:46:53 -0000
@@ -765,6 +765,9 @@
 #ifdef IPSEC_NAT_T
 	if ((sport != 0) && (dport != 0))
 		chkport = 1;
+#else
+	do { if (&sport) {} } while (/* CONSTCOND */ 0);
+	do { if (&dport) {} } while (/* CONSTCOND */ 0);
 #endif
 	/* sanity check */
 	if (src == NULL || dst == NULL)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Mon, 27 Jun 2016 09:02:57 +0000
Responsible-Changed-Why:
I'll own this.


State-Changed-From-To: open->feedback
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Mon, 27 Jun 2016 09:02:57 +0000
State-Changed-Why:
The problem does not seem to exist any more.  Although neither of the
suggeested fixes were committed, and there are no (alternative) uses
of __diagused for the variables in question,the following kernel builds
without error:

	include "arch/i386/conf/GENERIC"
	options MROUTING
	options IPSEC
	no options DIAGNOSTIC
	no options IPSEC_NAT_T

Unless there is any objection, I'll close out this PR in a week or so.


State-Changed-From-To: feedback->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Sun, 10 Jul 2016 23:27:37 +0000
State-Changed-Why:
No further feedback after fixing.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.