[Nagiosplug-checkins] SF.net SVN: nagiosplug: [2018] nagiosplug/trunk/plugins-root/check_dhcp.c

hweiss at users.sourceforge.net hweiss at users.sourceforge.net
Sun Jul 6 14:57:12 CEST 2008


Revision: 2018
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2018&view=rev
Author:   hweiss
Date:     2008-07-06 05:57:11 -0700 (Sun, 06 Jul 2008)

Log Message:
-----------
Don't try to set the "SO_BROADCAST" socket option for unicast requests.
(Also, removed the unused "DHCP_UNICAST_FLAG" macro.)

Modified Paths:
--------------
    nagiosplug/trunk/plugins-root/check_dhcp.c

Modified: nagiosplug/trunk/plugins-root/check_dhcp.c
===================================================================
--- nagiosplug/trunk/plugins-root/check_dhcp.c	2008-07-02 20:07:00 UTC (rev 2017)
+++ nagiosplug/trunk/plugins-root/check_dhcp.c	2008-07-06 12:57:11 UTC (rev 2018)
@@ -195,7 +195,6 @@
 #define DHCP_INFINITE_TIME              0xFFFFFFFF
 
 #define DHCP_BROADCAST_FLAG 32768
-#define DHCP_UNICAST_FLAG   0
 
 #define DHCP_SERVER_PORT   67
 #define DHCP_CLIENT_PORT   68
@@ -767,7 +766,7 @@
 	        }
 
         /* set the broadcast option - we need this to listen to DHCP broadcast messages */
-        if(setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){
+        if(!unicast && setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){
 		printf(_("Error: Could not set broadcast option on DHCP socket!\n"));
 		exit(STATE_UNKNOWN);
 	        }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list