Bug 86972 - net-mgmt/nagios-plugins - add option to disable IPV6
Summary: net-mgmt/nagios-plugins - add option to disable IPV6
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergey Matveychuk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-06 08:00 UTC by Oleksii Samorukov
Modified: 2005-10-16 17:19 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (588 bytes, patch)
2005-10-06 08:00 UTC, Oleksii Samorukov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksii Samorukov freebsd_committer 2005-10-06 08:00:28 UTC

This patch allow to build nagios-plugins w/o IPV6 support. 
I have problems with check_ping and check_icmp on ipv4 system when nagios-plugins are built with ipv6 support

How-To-Repeat: 

check_icmp can work incorrectly when it built on a system with ipv6 suppport but without real ipv6 address. 
After building without ipv6 support all start to work correctly
Comment 1 Marcus Alves Grando freebsd_committer 2005-10-06 13:32:39 UTC
Dear maintainer,

Do you approve this update?

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

Thanks

-- 
Marcus Alves Grando
marcus(at)corp.grupos.com.br  |  Grupos Internet S/A
  mnag(at)FreeBSD.org         |  FreeBSD.org
Comment 2 Marcus Alves Grando freebsd_committer 2005-10-06 13:32:48 UTC
State Changed
From-To: open->feedback

Ask for maintainer approval.
Comment 3 Blaz Zupan 2005-10-15 09:03:50 UTC
> Dear maintainer,
>
> Do you approve this update?
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=86972

I think that check_icmp not working in the situation described in the PR is a 
bug and should be fixed. But having a knob to turn off IPv6 is always good, so 
I agree with the patch. But IPv6 should be ON by default, not OFF. Below is 
the patch that should be commited.

This patch contains the following changes:
- add knob to turn off IPv6 support (by default IPv6 is turned on)
- fix compilation problem with check_snmp on FreeBSD 4.x
- reset maintainer to ports@FreeBSD.org, as I no longer have time to maintain
   the port.

diff -urN nagios-plugins.old/Makefile nagios-plugins/Makefile
--- nagios-plugins.old/Makefile	Fri Sep 30 10:25:47 2005
+++ nagios-plugins/Makefile	Sat Oct 15 09:40:20 2005
@@ -7,12 +7,13 @@

  PORTNAME=	nagios-plugins
  PORTVERSION=	1.4.2
+PORTREVISION=	1
  PORTEPOCH=	1
  CATEGORIES=	net-mgmt
  MASTER_SITES=	${MASTER_SITE_SOURCEFORGE_EXTENDED}
  MASTER_SITE_SUBDIR=	nagiosplug

-MAINTAINER=	blaz@si.FreeBSD.org
+MAINTAINER=	ports@FreeBSD.org
  COMMENT=	Plugins for nagios

  OPTIONS=	QSTAT "Game server query support" off \
@@ -21,7 +22,8 @@
  		RADIUS "Radius support" off \
  		MYSQL "MySQL support" off \
  		PGSQL "PostgreSQL support" off \
-		LDAP "OpenLDAP support" off
+		LDAP "OpenLDAP support" off \
+		IPV6 "IPV6 support" on

  .include <bsd.port.pre.mk>

@@ -94,6 +96,12 @@
  PLIST_SUB+=	SUB_LDAP=""
  .else
  PLIST_SUB+=	SUB_LDAP="@comment "
+.endif
+
+.if defined(WITH_IPV6)
+CONFIGURE_ARGS+=--with-ipv6
+.else
+CONFIGURE_ARGS+=--without-ipv6
  .endif

  CONFIGURE_ENV=	LOCALBASE=${LOCALBASE} LDFLAGS="-L${LOCALBASE}/lib" \
diff -urN nagios-plugins.old/files/patch-check_snmp.c nagios-plugins/files/patch-check_snmp.c
--- nagios-plugins.old/files/patch-check_snmp.c	Thu Jan  1 01:00:00 1970
+++ nagios-plugins/files/patch-check_snmp.c	Sat Oct 15 09:49:02 2005
@@ -0,0 +1,18 @@
+--- plugins/check_snmp.c.orig	Sat Oct 15 09:41:06 2005
++++ plugins/check_snmp.c	Sat Oct 15 09:48:43 2005
+@@ -206,6 +206,7 @@
+ 	strcat(perfstr, "| ");
+ 	while (ptr) {
+ 		char *foo;
++		char *str[MAX_INPUT_BUFFER];
+ 
+ 		foo = strstr (ptr, delimiter);
+ 		strncat(perfstr, ptr, foo-ptr);
+@@ -338,7 +339,6 @@
+ 
+ 		i++;
+ 
+-		char *str[MAX_INPUT_BUFFER];
+ 		asprintf(str, "=%s%s;;;; ", show, type ? type : "");
+ 		strcat(perfstr, *str);
+
Comment 4 Sergey Matveychuk freebsd_committer 2005-10-15 12:13:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sem

Take it.
Comment 5 Sergey Matveychuk freebsd_committer 2005-10-16 17:19:18 UTC
State Changed
From-To: feedback->closed

Committed, thanks!