Code

New plugin to check Citrix Metaframe XP "Program Neighbourhood"
[nagiosplug.git] / contrib / check_dhcp.c
index 2aea579dc1ff82548c29b443bf5e56c9fb0d53d9..8669e44ab5fad48067bbb82be689aa26b91d06d1 100644 (file)
@@ -4,7 +4,7 @@
 *
 * Program: DHCP plugin for Nagios
 * License: GPL
-* Copyright (c) 2001-2002 Ethan Galstad (nagios@nagios.org)
+* Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)
 *
 * License Information:
 *
@@ -470,7 +470,7 @@ int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, st
         /* make sure some data has arrived */
         if(!FD_ISSET(sock,&readfds)){
 #ifdef DEBUG
-                printf("No (more) data recieved\n");
+                printf("No (more) data received\n");
 #endif
                 return ERROR;
                 }
@@ -480,6 +480,7 @@ int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, st
                /* why do we need to peek first?  i don't know, its a hack.  without it, the source address of the first packet received was
                   not being interpreted correctly.  sigh... */
                bzero(&source_address,sizeof(source_address));
+               address_size=sizeof(source_address);
                 recv_result=recvfrom(sock,(char *)buffer,buffer_size,MSG_PEEK,(struct sockaddr *)&source_address,&address_size);
 #ifdef DEBUG
                printf("recv_result_1: %d\n",recv_result);
@@ -820,7 +821,7 @@ void print_help(void){
 
        /*print_revision(progname,"$Revision$");*/
 
-       printf("Copyright (c) 2001-2002 Ethan Galstad (nagios@nagios.org)\n\n");
+       printf("Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)\n\n");
        printf("This plugin tests the availability of DHCP servers on a network.\n\n");
 
        print_usage();