On Mon, Oct 16, 2017 at 01:18:27PM +0200, Martin Pieuchot wrote:
> Removing the if () block should do it.

This diff is not quite right.  /usr/src/regress/sbin/route rttest20
shows that there is an additional

+get net 2001:ee0:2001:c0::/64

each time you call route get.  You only want such a line in case of
an error.

ok?

bluhm

Index: route.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sbin/route/route.c,v
retrieving revision 1.204
diff -u -p -r1.204 route.c
--- route.c     16 Oct 2017 13:28:33 -0000      1.204
+++ route.c     17 Oct 2017 18:01:18 -0000
@@ -675,7 +675,7 @@ newroute(int argc, char **argv)
                        break;
        }
        oerrno = errno;
-       if (!qflag) {
+       if (!qflag && (*cmd != 'g' || oerrno)) {
                printf("%s %s %s", cmd, ishost ? "host" : "net", dest);
                if (*gateway) {
                        printf(": gateway %s", gateway);

Reply via email to