summaryrefslogtreecommitdiffstats
path: root/plugins-root/check_dhcp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-04-17Fixes for -Wunusedrefs/pull/1866/headRincewindsHat1-4/+0
* lib/utils_base.c * plugins/check_curl.c * plugins-root/check_dhcp.c Removed a line which theoretically can not do anything, but there was comment which indicated something else. Still trying this though.
2020-01-21Use size_t instead of int when calling sysctl(3).Vadim Zhukov1-1/+2
Otherwise, it writes sizeof(size_t) bytes to &oldlen, smashing the stack.
2016-12-07properly remove MSG_PEEK in check_dhcp.c. Fixes #1450.refs/pull/1454/headHarald Koch1-1/+1
2016-09-16check_dhcp: Make xid a bit more randomHolger Weiss1-3/+2
Don't just use the current time(2) to seed the PRNG that generates the xid. A DHCP server might be checked multiple times per second.
2016-09-14check_dhcp: Don't peek before reading responseHolger Weiss1-7/+1
Omit a recvfrom(3) call which has the MSG_PEEK flag set and should have no effect at all. According to a comment in the code, this call was meant to be a workaround to an opaque issue. If anyone runs into that issue, we should fix it properly instead.
2015-10-08Merge branch 'maint'Holger Weiss1-31/+12
* maint: sslutils: Remove superfluous parenthesis for sslv3 function too sslutils: remove superfluous parenthesis check_snmp: modified tests check_snmp.c: switched DEFAULT_TIMEOUT to DEFAULT_SOCKET_TIMEOUT (provided by utils.h), already used by help description, see issue #1318 install snmpd on travis tests enable libtab on travis builds add perl snmp to travis dependencies NEWS: Mention check_ups performance data fix Fix incorrect performance data thresholds check_dhcp: Fix option parsing Fixes segfaults when running via monitoring worker (off-by-one) travis: fix http test host sslutils: Check if OpenSSL supports SSLv3. Conflicts: NEWS plugins/sslutils.c
2015-10-04use unknown exit code for help/version in plugins-root as wellrefs/pull/1363/headSven Nierlein1-2/+2
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-02check_dhcp: Fix option parsingHolger Weiss1-31/+12
The call_getopt() function didn't always return the correct number of processed arguments. However, since check_dhcp doesn't support non-option arguments, the caller doesn't need this number anyway. Closes #1345.
2015-10-02Fixes segfaults when running via monitoring workerJan Wagner1-1/+1
(off-by-one) Grabed from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198318
2014-07-06check_icmp/check_dhcp: disable check, if we are rootJan Wagner1-3/+0
As it is possible to use capabilities(7) on linux or solaris privileges for example, it is not necessary in all cases to have those binaries making use of setuid.
2014-06-28plugins-root/check_dhcp.c - array out of boundsSpenser Reinhardt1-1/+1
Coverity 66488 - offer_packet->options has a max size of 312. It was being used in a loop verifying less than 311, but increasing by 2 per loop, causing a possible array index out of bounds. Changed to checking less than max length - 1. - SR
2014-01-20Capitalize "Monitoring" when it's the first wordHolger Weiss1-1/+1
2014-01-19Project rename initial commit.Monitoring Plugins Development Team1-3/+3
This is an initial take at renaming the project to Monitoring Plugins. It's not expected to be fully complete, and it is expected to break things (The perl module for instance). More testing will be required before this goes mainline.
2013-09-17check_dhcp: fix mac address and interface number detection on solarisSven Nierlein1-4/+9
newer (or x86) solaris implementations have interface names like e1000g0 which includes numbers. So we reverse the interface number detection to get the last number, instead of the first number.
2012-06-13check_dhcp: Don't misinterpret the "siaddr" fieldHolger Weiss1-9/+4
RFC 2131 (2.) says: "DHCP clarifies the interpretation of the 'siaddr' field as the address of the server to use in the next step of the client's bootstrap process." So, we shouldn't interpret this field as the DHCP server's own address. (#3503921 - Jason Ellison)
2012-06-13check_dhcp: Fix handling of "pad" optionsHolger Weiss1-3/+4
Don't let "pad" options[*] terminate the parsing of DHCP options. This bug was triggered by using check_dhcp against Windows 2003 DHCP servers (see #3503921). [*] Cf. RFC 2132, 3.1.
2010-04-22Add newline after "Usage:" in --helpThomas Guyot-Sionnest1-1/+1
2010-04-22Standardize the extra-opts notesThomas Guyot-Sionnest1-6/+0
2010-04-14Fix translations when extra-opts aren't enabledThomas Guyot-Sionnest1-5/+5
Bug #2832884 reported problem with translations outputting pot file headers. This is caused by "" matching the header of the translation files. This patch moves gettext macros inside utils macros and update some french translations.
2008-11-23Removing CVS/SVN tags and replacing with git-based versioningThomas Guyot-Sionnest1-6/+2
For contrib/, full tags have been imported from subversion git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19Bulk EOL cleanupThomas Guyot-Sionnest1-19/+19
$ git diff --ignore-space-change|diffstat 0 files changed git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
2008-07-06Don't try to set the "SO_BROADCAST" socket option for unicast requests.Holger Weiss1-2/+1
(Also, removed the unused "DHCP_UNICAST_FLAG" macro.) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2018 f882894a-f735-0410-b71e-b25c423dba1c
2008-05-07Added support for --extra-opts in all C plugins (disabled by default, see ↵Thomas Guyot-Sionnest1-0/+10
configure --help) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-29--help output cleanup (plus removal of spaces on blank lines)Thomas Guyot-Sionnest1-10/+11
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1985 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-31Bump plugins-root/ to GPLv3Thomas Guyot-Sionnest1-28/+23
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1920 f882894a-f735-0410-b71e-b25c423dba1c
2007-10-25Automatically update website with --help output. CosmeticTon Voon1-3/+3
fixes for some help output git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1810 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26The "--serverip" and "--requestedip" options now accept host names, too.Holger Weiss1-19/+19
This doesn't quite fit the option names and so far I haven't changed the "--help" output which currently only talks about IP addresses. However, I don't see why resolving host names should not be supported. Also note that for the moment, I added a quick'n'dirty resolve_host() function which should really go into netutils.c. I just wanted to think about its interface a bit more before providing such a function globally. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1766 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26New "-m, --mac" option which allows for specifying the MAC address toHolger Weiss1-12/+58
use in the DHCP request. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1765 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26Make sure strncpy(3)d buffers are nul-terminated.Holger Weiss1-3/+6
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1764 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26A few minor fixes/improvements which were included with (but unrelatedHolger Weiss1-6/+13
to) the "--unicast" patch (Andreas Ericsson and Heiti Ernits - 1218235) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1763 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26New "-u, --unicast" option which gives check_dhcp the ability to mimic aHolger Weiss1-10/+74
DHCP relay server in order to check remote subnets (Heiti Ernits and Andreas Ericsson - 1218235) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1762 f882894a-f735-0410-b71e-b25c423dba1c
2007-05-27added functions to utils_base:M. Sean Finney1-1/+4
np_check_if_root() - returns nonzero if geteuid()==0 np_warn_if_not_root() - uses the above to print an informative warning added uses of these functions to check_dhcp and check_icmp. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1718 f882894a-f735-0410-b71e-b25c423dba1c
2007-05-13check_dhcp now adds mandatory end option (Thanks to Enrico Scholz - #1675306)Matthias Eble1-6/+11
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1712 f882894a-f735-0410-b71e-b25c423dba1c
2007-04-20Remove unused variables.Holger Weiss1-2/+0
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1698 f882894a-f735-0410-b71e-b25c423dba1c
2007-04-20Use the 'server identifier' option instead of the 'siaddr' field as theHolger Weiss1-10/+28
DHCP server address; see RFC 2131, 2. (Denis Knauf - 1667488) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1694 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-28Don't try to print `optarg' (which will be a NULL pointer) if an unknownHolger Weiss1-1/+1
command line option was used, as this leads to a segfault on some systems. The unknown option will be printed by getopt(3) anyway. So, simply call print_usage() and exit UNKNOWN via the new usage5() instead. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1590 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-27Include <sys/param.h> which is a prerequisite for <sys/sysctl.h> onHolger Weiss1-0/+1
NetBSD and OpenBSD (at least). git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1584 f882894a-f735-0410-b71e-b25c423dba1c
2006-10-20localization updatesBenoit Mortier1-16/+27
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1511 f882894a-f735-0410-b71e-b25c423dba1c
2006-07-29Fix two Solaris compile problemsTon Voon1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1462 f882894a-f735-0410-b71e-b25c423dba1c
2006-05-25Applied patch for responses from helpers/relays, cleaned up different coding ↵Ethan Galstad1-181/+206
styles for consistency git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1408 f882894a-f735-0410-b71e-b25c423dba1c
2006-05-25Fixed short interface name length, UNKNOWN return code (patches from tracker)Ethan Galstad1-20/+19
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1405 f882894a-f735-0410-b71e-b25c423dba1c
2006-05-18Synchronise with coreutils 2.95. Gettext now synced with coreutils,Ton Voon1-7/+0
so no longer development platform requirement git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1394 f882894a-f735-0410-b71e-b25c423dba1c
2005-09-21Separation of root setuid plugins into plugins-root/Ton Voon1-0/+1261
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1233 f882894a-f735-0410-b71e-b25c423dba1c