Package: inetutils-ping
Version: 2:1.9.2.39.3a460-3
Severity: wishlist
Tags: patch

The existing version of inetutils-ping, if no "pattern" (-p option) is
specified, pads the ping packet with a sequence of bytes of ascending
value.

I suggest that this function could instead be fittingly fulfilled by
the use of the following sequence instead:

47 4e 55 20 54 65 72 72 79 20 50 72 61 74 63 68 65 74 74 20

See "Going Postal" for further information.

A patch is supplied.

-- 
Pigeon

Be kind to pigeons        - -        Pigeon's Nest: http://pigeonsnest.co.uk/
GPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F
diff -ru /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/debian/local/man/ping.1 /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/debian/local/man/ping.1
--- /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/debian/local/man/ping.1	2014-10-25 22:20:56.000000000 +0100
+++ /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/debian/local/man/ping.1	2015-04-08 20:24:20.996324389 +0100
@@ -110,7 +110,7 @@
 Numeric output only.
 No attempt will be made to lookup symbolic names for host addresses.
 .It Fl p Ar pattern
-You may specify up to 16 ``pad'' bytes to fill out the packet you send.
+You may specify up to 20 ``pad'' bytes to fill out the packet you send.
 This is useful for diagnosing data-dependent problems in a network.
 For example,
 .Dq Li \-p ff
diff -ru /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/doc/inetutils.texi /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/doc/inetutils.texi
--- /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/doc/inetutils.texi	2014-10-25 20:53:34.000000000 +0100
+++ /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/doc/inetutils.texi	2015-04-08 20:25:34.252932546 +0100
@@ -701,7 +701,7 @@
 @itemx --pattern=@var{pat}
 @opindex -p
 @opindex --pattern
-You may specify up to 16 pad bytes to fill out the packet you send.
+You may specify up to 20 pad bytes to fill out the packet you send.
 This is useful for diagnosing data-dependent problems in a network.
 For example, @option{-p ff} will cause the sent packet to be filled
 with all ones.
@@ -958,7 +958,7 @@
 @itemx --pattern=@var{pattern}
 @opindex -p
 @opindex --pattern
-Up to 16 hexadecimal pad bytes are given as @var{pattern}.
+Up to 20 hexadecimal pad bytes are given as @var{pattern}.
 These are use for filling out the packets you send.
 This option is useful for diagnosing data-dependent problems
 within a network.
diff -ru /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/ping/ping_common.c /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/ping/ping_common.c
--- /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/ping/ping_common.c	2014-10-25 20:53:35.000000000 +0100
+++ /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/ping/ping_common.c	2015-04-08 20:17:02.884687314 +0100
@@ -70,6 +70,15 @@
 
   data_buffer = xmalloc (data_length);
 
+#ifdef DEFAULTPATTERN
+  if (!pat) pat = DEFAULTPATTERN;
+      for (p = data_buffer; p < data_buffer + data_length; p++)
+	{
+	  *p = pat[i];
+	  if (++i >= len)
+	    i = 0;
+	}
+#else
   if (pat)
     {
       for (p = data_buffer; p < data_buffer + data_length; p++)
@@ -84,6 +93,7 @@
       for (i = 0; i < data_length; i++)
 	data_buffer[i] = i;
     }
+#endif /* ifdef DEFAULTPATTERN */
 }
 
 void
diff -ru /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/ping/ping_common.h /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/ping/ping_common.h
--- /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460.orig/ping/ping_common.h	2014-10-25 20:53:35.000000000 +0100
+++ /home/pigeon/debian/inetutils/inetutils-1.9.2.39.3a460/ping/ping_common.h	2015-04-08 20:42:55.641577853 +0100
@@ -27,8 +27,15 @@
 
 #include <stdbool.h>
 
+#define DEFAULTPATTERN "\x47\x4e\x55\x20\x54\x65\x72\x72\x79\x20" \
+	                   "\x50\x72\x61\x74\x63\x68\x65\x74\x74\x20"
+
 #define MAXWAIT         10	/* Max seconds to wait for response.  */
-#define MAXPATTERN      16	/* Maximal length of pattern.  */
+#ifdef DEFAULTPATTERN
+#define MAXPATTERN      20	/* Maximal length of pattern = length of DEFAULTPATTERN  */
+#else
+#define MAXPATTERN      16  /* original value */
+#endif
 
 #define OPT_FLOOD       0x001
 #define OPT_INTERVAL    0x002

Attachment: signature.asc
Description: Digital signature

Reply via email to