aboutsummaryrefslogtreecommitdiff
path: root/plugins-root/check_dhcp.c
diff options
context:
space:
mode:
authorGravatar Holger Weiss <hweiss@users.sourceforge.net> 2008-07-06 12:57:11 +0000
committerGravatar Holger Weiss <hweiss@users.sourceforge.net> 2008-07-06 12:57:11 +0000
commit830f3cc38a0b7ddcb80dc322f7f60f7f73ac9bfe (patch)
tree7b3db5f748a57180857db015a20e20655048b289 /plugins-root/check_dhcp.c
parentf1bfe40afb671f5af4b32c446cbcbd8b61343739 (diff)
downloadmonitoring-plugins-830f3cc38a0b7ddcb80dc322f7f60f7f73ac9bfe.tar.gz
Don't try to set the "SO_BROADCAST" socket option for unicast requests.
(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
Diffstat (limited to 'plugins-root/check_dhcp.c')
-rw-r--r--plugins-root/check_dhcp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index 241f13ed..5781f758 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -195,7 +195,6 @@ typedef struct requested_server_struct{
#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 @@ int create_dhcp_socket(void){
}
/* 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);
}