summaryrefslogtreecommitdiffstats
path: root/plugins-root/check_icmp.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-03-12 20:12:37 +0100
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-04-18 00:20:12 +0200
commit907b933a87ae21ad776c53a2dd7f04beb220b6bf (patch)
tree0de0332d0921f3a77781c86d6b96f3264b41d043 /plugins-root/check_icmp.c
parentf7687d47cb0841d0bc12ef205fcbaef8bf2e3805 (diff)
downloadmonitoring-plugins-907b933.tar.gz
Fixes for -Wunused-parameters
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r--plugins-root/check_icmp.c4
1 files changed, 4 insertions, 0 deletions
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