Subject: bin/998: route -q makes noise
To: None <gnats-admin@NetBSD.ORG>
From: John Hawkinson <jhawk@MIT.EDU>
List: netbsd-bugs
Date: 04/26/1995 22:20:10
>Number: 998
>Category: bin
>Synopsis: route -q makes noise
>Confidential: yes
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 26 22:20:05 1995
>Originator: John Hawkinson
>Organization:
MIT SIPB
>Release: 12 April
>Environment:
System: NetBSD lola-granola 1.0A NetBSD 1.0A (ATHENA-AHA) #7: Wed Apr 26 02:01:02 GMT 1995 ghudson@limekiller:/afs/sipb.mit.edu/project/netbsd/dev/current-source/src/sys/arch/i386/compile/ATHENA-AHA i386
>Description:
route -q does not ``suppress all output'' like route(8)
claims it should.
>How-To-Repeat:
./route -q delete 18.70.0.1
delete host 18.70.0.1
>Fix:
diff -c -r1.1 route.c
*** route.c 1995/04/27 05:04:22 1.1
--- route.c 1995/04/27 05:05:19
***************
*** 678,693 ****
if (*cmd == 'g')
exit(0);
oerrno = errno;
! (void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
! if (*gateway) {
! (void) printf(": gateway %s", gateway);
! if (attempts > 1 && ret == 0 && af == AF_INET)
! (void) printf(" (%s)",
! inet_ntoa(((struct sockaddr_in *)&route.rt_gateway)->sin_addr));
}
! if (ret == 0)
! (void) printf("\n");
! else {
switch (oerrno) {
case ESRCH:
err = "not in table";
--- 678,695 ----
if (*cmd == 'g')
exit(0);
oerrno = errno;
! if ((!qflag) && (ret==0)) {
! (void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
! if (*gateway) {
! (void) printf(": gateway %s", gateway);
! if (attempts > 1 && ret == 0 && af == AF_INET)
! (void) printf(" (%s)",
! inet_ntoa(((struct sockaddr_in *)&route.rt_gateway)->sin_addr));
! }
! if (ret == 0)
! (void) printf("\n");
}
! if (ret != 0) {
switch (oerrno) {
case ESRCH:
err = "not in table";
>Audit-Trail:
>Unformatted: