summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 241f13e..5781f75 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -195,7 +195,6 @@ typedef struct requested_server_struct{
195#define DHCP_INFINITE_TIME 0xFFFFFFFF 195#define DHCP_INFINITE_TIME 0xFFFFFFFF
196 196
197#define DHCP_BROADCAST_FLAG 32768 197#define DHCP_BROADCAST_FLAG 32768
198#define DHCP_UNICAST_FLAG 0
199 198
200#define DHCP_SERVER_PORT 67 199#define DHCP_SERVER_PORT 67
201#define DHCP_CLIENT_PORT 68 200#define DHCP_CLIENT_PORT 68
@@ -767,7 +766,7 @@ int create_dhcp_socket(void){
767 } 766 }
768 767
769 /* set the broadcast option - we need this to listen to DHCP broadcast messages */ 768 /* set the broadcast option - we need this to listen to DHCP broadcast messages */
770 if(setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){ 769 if(!unicast && setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){
771 printf(_("Error: Could not set broadcast option on DHCP socket!\n")); 770 printf(_("Error: Could not set broadcast option on DHCP socket!\n"));
772 exit(STATE_UNKNOWN); 771 exit(STATE_UNKNOWN);
773 } 772 }