From nobody@FreeBSD.org  Sat Jan 21 14:28:49 2012
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 DD11E106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Jan 2012 14:28:48 +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 BE5C08FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Jan 2012 14:28:48 +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 q0LESmZA093179
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 21 Jan 2012 14:28:48 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q0LESmh0093178;
	Sat, 21 Jan 2012 14:28:48 GMT
	(envelope-from nobody)
Message-Id: <201201211428.q0LESmh0093178@red.freebsd.org>
Date: Sat, 21 Jan 2012 14:28:48 GMT
From: Ivan Rozhuk <rozhuk.im@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ifmcstat build fail without -DWITH_KVM
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164353
>Category:       bin
>Synopsis:       ifmcstat(8) build fail without -DWITH_KVM
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    maxim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 21 14:30:10 UTC 2012
>Closed-Date:    Fri Aug 31 06:35:20 UTC 2012
>Last-Modified:  Fri Aug 31 06:35:20 UTC 2012
>Originator:     Ivan Rozhuk
>Release:        9.0
>Organization:
>Environment:
FreeBSD firewall 9.0-STABLE FreeBSD 9.0-STABLE #0: Sat Jan 21 11:32:18 IRKT 2012     root@firewall:/tmp/obj/usr/src/sys/RIM  i386

>Description:
/usr/src/usr.sbin/ifmcstat
Build fail without libkvm

# cd /usr/src/usr.sbin/ifmcstat
# make
Warning: Object directory not changed from original /usr/src/usr.sbin/ifmcstat
cc -O2 -fno-strict-aliasing -pipe -DINET6 -DNDEBUG -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c ifmcstat.c
ifmcstat.c:169: warning: 'in6_ifinfo' used but never defined
cc -O2 -fno-strict-aliasing -pipe -DINET6 -DNDEBUG -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c printb.c
cc -O2 -fno-strict-aliasing -pipe -DINET6 -DNDEBUG -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign  -o ifmcstat ifmcstat.o printb.o 
ifmcstat.o(.text+0xb92): In function `main':
: undefined reference to `in6_ifinfo'
*** Error code 1

Stop in /usr/src/usr.sbin/ifmcstat.
Exit 1

>How-To-Repeat:
Add to /etc/src.conf

WITHOUT_KVM=
# Set to not build the libkvm library as a part of the base system.

WITHOUT_KVM_SUPPORT=
# Set to build some programs without optional libkvm support.

Next:
cd /usr/src/usr.sbin/ifmcstat
make clean
make

>Fix:
apply patch

Patch attached with submission follows:

--- /usr/src/usr.sbin/ifmcstat/ifmcstat_orig.c	2012-01-21 22:16:42.000000000 +0900
+++ /usr/src/usr.sbin/ifmcstat/ifmcstat.c	2012-01-21 22:18:37.000000000 +0900
@@ -441,32 +441,6 @@
 #ifdef INET6
 
 static void
-in6_ifinfo(struct mld_ifinfo *mli)
-{
-
-	printf("\t");
-	switch (mli->mli_version) {
-	case MLD_VERSION_1:
-	case MLD_VERSION_2:
-		printf("mldv%d", mli->mli_version);
-		break;
-	default:
-		printf("mldv?(%d)", mli->mli_version);
-		break;
-	}
-	printb(" flags", mli->mli_flags, "\020\1SILENT");
-	if (mli->mli_version == MLD_VERSION_2) {
-		printf(" rv %u qi %u qri %u uri %u",
-		    mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri);
-	}
-	if (vflag >= 2) {
-		printf(" v1timer %u v2timer %u", mli->mli_v1_timer,
-		   mli->mli_v2_timer);
-	}
-	printf("\n");
-}
-
-static void
 if6_addrlist(struct ifaddr *ifap)
 {
 	struct ifnet ifnet;
@@ -763,6 +737,32 @@
 #endif /* WITH_KVM */
 
 #ifdef INET6
+static void
+in6_ifinfo(struct mld_ifinfo *mli)
+{
+
+	printf("\t");
+	switch (mli->mli_version) {
+	case MLD_VERSION_1:
+	case MLD_VERSION_2:
+		printf("mldv%d", mli->mli_version);
+		break;
+	default:
+		printf("mldv?(%d)", mli->mli_version);
+		break;
+	}
+	printb(" flags", mli->mli_flags, "\020\1SILENT");
+	if (mli->mli_version == MLD_VERSION_2) {
+		printf(" rv %u qi %u qri %u uri %u",
+		    mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri);
+	}
+	if (vflag >= 2) {
+		printf(" v1timer %u v2timer %u", mli->mli_v1_timer,
+		   mli->mli_v2_timer);
+	}
+	printf("\n");
+}
+
 static const char *
 inet6_n2a(struct in6_addr *p)
 {


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Fri Jan 27 17:16:55 UTC 2012 
State-Changed-Why:  
Fixed in HEAD.  Thanks for the patch! 


Responsible-Changed-From-To: freebsd-bugs->maxim 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Fri Jan 27 17:16:55 UTC 2012 
Responsible-Changed-Why:  
MFC reminder. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/164353: commit references a PR
Date: Fri, 27 Jan 2012 17:16:54 +0000 (UTC)

 Author: maxim
 Date: Fri Jan 27 17:16:44 2012
 New Revision: 230617
 URL: http://svn.freebsd.org/changeset/base/230617
 
 Log:
   o in6_ifinfo() does not do any kvm(3) operations, so
   do not guard it by WITH_KVM ifdef.  This allows to build
   ifmcstat(8) without kvm(3) support.
   
   PR:		bin/164353
   Submitted by:	Ivan Rozhuk
   MFC after:	2 weeks
 
 Modified:
   head/usr.sbin/ifmcstat/ifmcstat.c
 
 Modified: head/usr.sbin/ifmcstat/ifmcstat.c
 ==============================================================================
 --- head/usr.sbin/ifmcstat/ifmcstat.c	Fri Jan 27 14:50:15 2012	(r230616)
 +++ head/usr.sbin/ifmcstat/ifmcstat.c	Fri Jan 27 17:16:44 2012	(r230617)
 @@ -441,32 +441,6 @@ ll_addrlist(struct ifaddr *ifap)
  #ifdef INET6
  
  static void
 -in6_ifinfo(struct mld_ifinfo *mli)
 -{
 -
 -	printf("\t");
 -	switch (mli->mli_version) {
 -	case MLD_VERSION_1:
 -	case MLD_VERSION_2:
 -		printf("mldv%d", mli->mli_version);
 -		break;
 -	default:
 -		printf("mldv?(%d)", mli->mli_version);
 -		break;
 -	}
 -	printb(" flags", mli->mli_flags, "\020\1SILENT");
 -	if (mli->mli_version == MLD_VERSION_2) {
 -		printf(" rv %u qi %u qri %u uri %u",
 -		    mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri);
 -	}
 -	if (vflag >= 2) {
 -		printf(" v1timer %u v2timer %u", mli->mli_v1_timer,
 -		   mli->mli_v2_timer);
 -	}
 -	printf("\n");
 -}
 -
 -static void
  if6_addrlist(struct ifaddr *ifap)
  {
  	struct ifnet ifnet;
 @@ -763,6 +737,33 @@ in_multientry(struct in_multi *pinm)
  #endif /* WITH_KVM */
  
  #ifdef INET6
 +
 +static void
 +in6_ifinfo(struct mld_ifinfo *mli)
 +{
 +
 +	printf("\t");
 +	switch (mli->mli_version) {
 +	case MLD_VERSION_1:
 +	case MLD_VERSION_2:
 +		printf("mldv%d", mli->mli_version);
 +		break;
 +	default:
 +		printf("mldv?(%d)", mli->mli_version);
 +		break;
 +	}
 +	printb(" flags", mli->mli_flags, "\020\1SILENT");
 +	if (mli->mli_version == MLD_VERSION_2) {
 +		printf(" rv %u qi %u qri %u uri %u",
 +		    mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri);
 +	}
 +	if (vflag >= 2) {
 +		printf(" v1timer %u v2timer %u", mli->mli_v1_timer,
 +		   mli->mli_v2_timer);
 +	}
 +	printf("\n");
 +}
 +
  static const char *
  inet6_n2a(struct in6_addr *p)
  {
 _______________________________________________
 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: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Fri Aug 31 06:35:02 UTC 2012 
State-Changed-Why:  
Merged to stable/9. 

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