summaryrefslogtreecommitdiffstats
path: root/plugins-root
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-root')
-rw-r--r--plugins-root/check_dhcp.c12
-rw-r--r--plugins-root/check_icmp.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index ad673237..2d742349 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -229,7 +229,7 @@ struct in_addr requested_address;
229 229
230int process_arguments(int, char **); 230int process_arguments(int, char **);
231int call_getopt(int, char **); 231int call_getopt(int, char **);
232int validate_arguments(int, int); 232int validate_arguments(int);
233void print_usage(void); 233void print_usage(void);
234void print_help(void); 234void print_help(void);
235 235
@@ -1059,8 +1059,8 @@ int process_arguments(int argc, char **argv){
1059 return ERROR; 1059 return ERROR;
1060 1060
1061 arg_index = call_getopt(argc,argv); 1061 arg_index = call_getopt(argc,argv);
1062 return validate_arguments(argc,arg_index); 1062 return validate_arguments(argc);
1063 } 1063}
1064 1064
1065 1065
1066 1066
@@ -1158,13 +1158,13 @@ int call_getopt(int argc, char **argv){
1158 } 1158 }
1159 1159
1160 1160
1161int validate_arguments(int argc, int arg_index){ 1161int validate_arguments(int argc){
1162 1162
1163 if(argc-optind > 0) 1163 if(argc - optind > 0)
1164 usage(_("Got unexpected non-option argument")); 1164 usage(_("Got unexpected non-option argument"));
1165 1165
1166 return OK; 1166 return OK;
1167 } 1167}
1168 1168
1169 1169
1170#if defined(__sun__) || defined(__solaris__) || defined(__hpux__) 1170#if defined(__sun__) || defined(__solaris__) || defined(__hpux__)
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 9ceb35b2..edfd6949 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -1436,11 +1436,15 @@ get_ip_address(const char *ifname)
1436 struct ifreq ifr; 1436 struct ifreq ifr;
1437 1437
1438 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1); 1438 strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1);
1439
1439 ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; 1440 ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
1441
1440 if(ioctl(icmp_sock, SIOCGIFADDR, &ifr) == -1) 1442 if(ioctl(icmp_sock, SIOCGIFADDR, &ifr) == -1)
1441 crash("Cannot determine IP address of interface %s", ifname); 1443 crash("Cannot determine IP address of interface %s", ifname);
1444
1442 memcpy(&ip, &ifr.ifr_addr, sizeof(ip)); 1445 memcpy(&ip, &ifr.ifr_addr, sizeof(ip));
1443#else 1446#else
1447 (void) ifname;
1444 errno = 0; 1448 errno = 0;
1445 crash("Cannot get interface IP address on this platform."); 1449 crash("Cannot get interface IP address on this platform.");
1446#endif 1450#endif