Bug 196964 - net-mgmt/nagios-plugins: Fix for check_dhcp (not only) on FreeBSD 10
Summary: net-mgmt/nagios-plugins: Fix for check_dhcp (not only) on FreeBSD 10
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Mathieu Arnold
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-21 12:58 UTC by Rudolf Čejka
Modified: 2015-01-21 13:12 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (mat)


Attachments
check_dhcp.c fix (469 bytes, patch)
2015-01-21 12:58 UTC, Rudolf Čejka
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Čejka 2015-01-21 12:58:08 UTC
Created attachment 151948 [details]
check_dhcp.c fix

The bug is reported here: https://github.com/nagios-plugins/nagios-plugins/issues/70

There is a bug in getting MAC address of network interface on BSD systems, where fourth parameter in sysctl() has to be size_t * and not int *. Unfortunately, using gcc -O2 the bug is hidden and contrary to compiler warning, check_dhcp seems to be working. However, when you use gcc -O0 or gcc -O1 or clang in FreeBSD 10 on amd64, the bug is exposed:

./check_dhcp -i em0 -s 127.0.0.1
Error: Couldn't get hardware address from em0. sysctl 2 error - No such file or directory.

Until it is fixed in upstream, please add the patch to the current nagios-plugins 2.0.3.

Thank you very much.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-01-21 12:58:08 UTC
Auto-assigned to maintainer mat@FreeBSD.org
Comment 2 Rudolf Čejka 2015-01-21 13:00:27 UTC
Oops, the name of the file had to be patch-plugins-root__check_dhcp.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-01-21 13:12:29 UTC
A commit references this bug:

Author: mat
Date: Wed Jan 21 13:11:30 UTC 2015
New revision: 377599
URL: https://svnweb.freebsd.org/changeset/ports/377599

Log:
  Fix check_dhcp.

  PR:		196964
  Submitted by:	Rudolf ?ejka
  Sponsored by:	Absolight

Changes:
  head/net-mgmt/monitoring-plugins/Makefile
  head/net-mgmt/monitoring-plugins/files/patch-plugins-root_check__dhcp.c
  head/net-mgmt/nagios-plugins/Makefile
  head/net-mgmt/nagios-plugins/files/patch-plugins-root_check__dhcp.c