Subject: bin/7815: ping doesn't work over the telephone :)
To: None <gnats-bugs@gnats.netbsd.org>
From: TheMan <andrew@untraceable.net>
List: netbsd-bugs
Date: 06/19/1999 11:51:06
>Number:         7815
>Category:       bin
>Synopsis:       ping doesn't work over telephone distances; can't see screen
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 19 11:50:01 1999
>Last-Modified:
>Originator:     TheMan
>Organization:
i and i
>Release:        1.3.3 and -current
>Environment:
System: NetBSD noc 1.3.3 NetBSD 1.3.3 (LINGAM) #1: Tue Apr 13 12:33:49 EDT 1999 andrew@noc:/usr/src/sys/arch/i386/compile/LINGAM i386


>Description:

find a wiring closet on the other side of the building with unmarked
ports on the patch panels.  notice that all your machines (while they
work) are plugged into unmarked ports.  decide to label the ports.
jump up and down in frustration at the size of the task at hand.

>How-To-Repeat:

apply the following path, and repeatedly ping -a each machine in turn.
call your cell phone from your desk phone, place the handset near the
computer's speaker, and take the cell phone with you into the closet.
find each port by repeatedly unplugging and plugging back in each port
on the hub.  you can find them one at a time by making the beeping in
your head go away.

>Fix:

--- ping.c-orig	Tue May 18 11:55:44 1999
+++ ping.c	Sat Jun 19 14:26:58 1999
@@ -175,6 +175,7 @@
 int optlen;
 
 
+int audible;				/* audible ping responses */
 int npackets;				/* total packets to send */
 int preload;				/* number of packets to "preload" */
 int ntransmitted;			/* output sequence # = #sent */
@@ -245,8 +246,11 @@
 	__progname = argv[0];
 #endif
 	while ((c = getopt(argc, argv,
-			   "c:dDfg:h:i:I:l:Lnop:PqQrRs:t:T:vw:")) != -1) {
+			   "ac:dDfg:h:i:I:l:Lnop:PqQrRs:t:T:vw:")) != -1) {
 		switch (c) {
+		case 'a':
+			audible = 1;
+			break;
 		case 'c':
 			npackets = strtol(optarg, &p, 0);
 			if (*p != '\0' || npackets <= 0)
@@ -790,6 +794,8 @@
 	(void)printf(" ttl=%d", ttl);
 	if (pingflags & F_TIMING)
 		(void)printf(" time=%.3f ms", triptime*1000.0);
+	if (audible && !dupflag)
+		(void)printf("\a");
 }
 
 
--- ping.8-orig	Sun Jun 13 07:10:54 1999
+++ ping.8	Sat Jun 19 14:29:33 1999
@@ -44,7 +44,7 @@
 .Sh SYNOPSIS
 .Nm ""
 .Bk -words
-.Op Fl dfnoqrvDPQRL
+.Op Fl adfnoqrvDPQRL
 .Ek
 .Bk -words
 .Op Fl c Ar count
@@ -96,6 +96,9 @@
 packet.
 The options are as follows:
 .Bl -tag -width Ds
+.It Fl a
+Emit an audible beep after each response is received (but not for
+duplicate responses or flood pings).
 .It Fl c Ar count
 Stop after sending (and waiting the specified delay to receive)
 .Ar count

>Audit-Trail:
>Unformatted: