summaryrefslogtreecommitdiffstats
path: root/plugins-root/check_icmp.c
diff options
context:
space:
mode:
authorMatthias Eble <psychotrahe@users.sourceforge.net>2008-07-28 20:15:52 +0000
committerMatthias Eble <psychotrahe@users.sourceforge.net>2008-07-28 20:15:52 +0000
commit3c38fc752e6015541416b7aa9e5b7a740a8357fe (patch)
treec4f6e20d53b0db10d55d9c8b954c09c4b60c9e34 /plugins-root/check_icmp.c
parentc64070fd3f924b02a517117bba2dfe702d020a9b (diff)
downloadmonitoring-plugins-3c38fc752e6015541416b7aa9e5b7a740a8357fe.tar.gz
-b option now specifies ICMP data bytes instead of packet size
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2027 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r--plugins-root/check_icmp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 5fb9c364..fe1f9eef 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -463,13 +463,13 @@ main(int argc, char **argv)
463 case 'b': 463 case 'b':
464 size = strtol(optarg,NULL,0); 464 size = strtol(optarg,NULL,0);
465 if (size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) && 465 if (size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) &&
466 size <= MAX_PING_DATA + ICMP_MINLEN) { 466 size < MAX_PING_DATA) {
467 icmp_pkt_size = size; 467 icmp_data_size = size;
468 icmp_data_size = icmp_pkt_size - ICMP_MINLEN; 468 icmp_pkt_size = size + ICMP_MINLEN;
469 } else 469 } else
470 usage_va("ICMP packet size must be between: %d and %d", 470 usage_va("ICMP data length must be between: %d and %d",
471 sizeof(struct icmp) + sizeof(struct icmp_ping_data), 471 sizeof(struct icmp) + sizeof(struct icmp_ping_data),
472 MAX_PING_DATA + ICMP_MINLEN); 472 MAX_PING_DATA - 1);
473 473
474 break; 474 break;
475 case 'i': 475 case 'i':
@@ -1301,8 +1301,8 @@ print_help(void)
1301 printf (" %s",_("timeout value (seconds, currently ")); 1301 printf (" %s",_("timeout value (seconds, currently "));
1302 printf ("%u)\n", timeout); 1302 printf ("%u)\n", timeout);
1303 printf (" %s\n", "-b"); 1303 printf (" %s\n", "-b");
1304 printf (" %s", _("icmp packet size (bytes, currently ")); 1304 printf (" %s\n", _("Number of icmp data bytes to send"));
1305 printf ("%u)\n", icmp_pkt_size); 1305 printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN);
1306 printf (" %s\n", "-v"); 1306 printf (" %s\n", "-v");
1307 printf (" %s\n", _("verbose")); 1307 printf (" %s\n", _("verbose"));
1308 1308