svn commit: r279028 - in head/usr.sbin: . ifmcstat

Gleb Smirnoff glebius at FreeBSD.org
Thu Feb 19 22:42:36 UTC 2015


Author: glebius
Date: Thu Feb 19 22:42:33 2015
New Revision: 279028
URL: https://svnweb.freebsd.org/changeset/base/279028

Log:
  Now that IGMP and MLD sysctls provide a clean API structures that do not
  leak kernel internal stuff, reconnect ifmcstat(1) back to build.  However,
  disable kvm(3) support in it, since it requires uncovering tons of _KERNEL
  defined declarations, which can be achieved either uncovering them globally
  or providing dirty hacks such as _WANT_IFADDR.  If anyone demands an
  ifmcstat-like kvm-based tool, please take the code out of usr.sbin/ifmstat
  and create a tool in src/tools/tools.

Modified:
  head/usr.sbin/Makefile
  head/usr.sbin/ifmcstat/Makefile
  head/usr.sbin/ifmcstat/ifmcstat.c

Modified: head/usr.sbin/Makefile
==============================================================================
--- head/usr.sbin/Makefile	Thu Feb 19 22:37:01 2015	(r279027)
+++ head/usr.sbin/Makefile	Thu Feb 19 22:42:33 2015	(r279028)
@@ -94,8 +94,6 @@ SUBDIR=	adduser \
 	watchdogd \
 	zic
 
-SUBDIR:=	${SUBDIR:Nifmcstat}
-
 # NB: keep these sorted by MK_* knobs
 
 .if ${MK_ACCT} != "no"

Modified: head/usr.sbin/ifmcstat/Makefile
==============================================================================
--- head/usr.sbin/ifmcstat/Makefile	Thu Feb 19 22:37:01 2015	(r279027)
+++ head/usr.sbin/ifmcstat/Makefile	Thu Feb 19 22:42:33 2015	(r279028)
@@ -15,9 +15,4 @@ WARNS?=	2
 CFLAGS+=-DINET6
 .endif
 
-.if ${MK_KVM_SUPPORT} != "no"
-CFLAGS+=-DWITH_KVM
-LIBADD=	kvm
-.endif
-
 .include <bsd.prog.mk>

Modified: head/usr.sbin/ifmcstat/ifmcstat.c
==============================================================================
--- head/usr.sbin/ifmcstat/ifmcstat.c	Thu Feb 19 22:37:01 2015	(r279027)
+++ head/usr.sbin/ifmcstat/ifmcstat.c	Thu Feb 19 22:42:33 2015	(r279028)
@@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/tree.h>
 
 #include <net/if.h>
-#define	_WANT_IFADDR
 #include <net/if_var.h>
 #include <net/if_types.h>
 #include <net/if_dl.h>
@@ -52,20 +51,12 @@ __FBSDID("$FreeBSD$");
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/igmp.h>
-#define KERNEL
-# include <netinet/if_ether.h>
-#undef KERNEL
-#define _KERNEL
-#define SYSCTL_DECL(x)
-# include <netinet/igmp_var.h>
-#undef SYSCTL_DECL
-#undef _KERNEL
+#include <netinet/if_ether.h>
+#include <netinet/igmp_var.h>
 
 #ifdef INET6
 #include <netinet/icmp6.h>
-#define _KERNEL
-# include <netinet6/mld6_var.h>
-#undef _KERNEL
+#include <netinet6/mld6_var.h>
 #endif /* INET6 */
 
 #include <arpa/inet.h>
@@ -82,14 +73,23 @@ __FBSDID("$FreeBSD$");
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <kvm.h>
 #include <limits.h>
 #include <ifaddrs.h>
-#include <nlist.h>
 #include <sysexits.h>
 #include <unistd.h>
 
-/* XXX: This file currently assumes INET and KVM support in the base system. */
+#ifdef KVM
+/*
+ * Currently the KVM build is broken. To be fixed it requires uncovering
+ * large amount of _KERNEL code in include files, and it is also very
+ * tentative to internal kernel ABI changes. If anyone wishes to restore
+ * it, please move it out of src/usr.sbin to src/tools/tools.
+ */
+#include <kvm.h>
+#include <nlist.h>
+#endif
+
+/* XXX: This file currently assumes INET support in the base system. */
 #ifndef INET
 #define INET
 #endif


More information about the svn-src-all mailing list