Sat Aug 29 19:28:32 2020 UTC ()
Make the "interesting" flags match the netstat ones, so:

    route show -inet
    netstat -r -f inet

outputs match.


(christos)
diff -r1.50 -r1.51 src/sbin/route/show.c

cvs diff -r1.50 -r1.51 src/sbin/route/show.c (expand / switch to unified diff)

--- src/sbin/route/show.c 2016/04/04 07:37:07 1.50
+++ src/sbin/route/show.c 2020/08/29 19:28:32 1.51
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: show.c,v 1.50 2016/04/04 07:37:07 ozaki-r Exp $ */ 1/* $NetBSD: show.c,v 1.51 2020/08/29 19:28:32 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1983, 1988, 1993 4 * Copyright (c) 1983, 1988, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#ifndef lint 33#ifndef lint
34#if 0 34#if 0
35static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; 35static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
36#else 36#else
37__RCSID("$NetBSD: show.c,v 1.50 2016/04/04 07:37:07 ozaki-r Exp $"); 37__RCSID("$NetBSD: show.c,v 1.51 2020/08/29 19:28:32 christos Exp $");
38#endif 38#endif
39#endif /* not lint */ 39#endif /* not lint */
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/protosw.h> 42#include <sys/protosw.h>
43#include <sys/socket.h> 43#include <sys/socket.h>
44 44
45#include <arpa/inet.h> 45#include <arpa/inet.h>
46#include <net/if.h> 46#include <net/if.h>
47#include <net/if_dl.h> 47#include <net/if_dl.h>
48#include <net/if_types.h> 48#include <net/if_types.h>
49#include <net/route.h> 49#include <net/route.h>
50#include <netinet/in.h> 50#include <netinet/in.h>
@@ -122,19 +122,21 @@ parse_show_opts(int argc, char * const * @@ -122,19 +122,21 @@ parse_show_opts(int argc, char * const *
122 if (afnamep != NULL) 122 if (afnamep != NULL)
123 *afnamep = afname; 123 *afnamep = afname;
124 *afp = af; 124 *afp = af;
125 *flagsp = flags; 125 *flagsp = flags;
126} 126}
127 127
128/* 128/*
129 * Print routing tables. 129 * Print routing tables.
130 */ 130 */
131void 131void
132show(int argc, char *const *argv, int flags) 132show(int argc, char *const *argv, int flags)
133{ 133{
134 int af, rflags; 134 int af, rflags;
135 static int interesting = RTF_UP | RTF_GATEWAY | RTF_HOST | 135 static int interesting = RTF_ANNOUNCE | RTF_BLACKHOLE | RTF_BROADCAST |
136 RTF_REJECT | RTF_LOCAL | RTF_BROADCAST; 136 RTF_CONNECTED | RTF_DYNAMIC | RTF_GATEWAY | RTF_HOST | RTF_LLDATA |
 137 RTF_LOCAL | RTF_MODIFIED | RTF_PROTO1 | RTF_PROTO2 | RTF_REJECT |
 138 RTF_STATIC | RTF_UP;
137 139
138 parse_show_opts(argc, argv, &af, &rflags, NULL, true); 140 parse_show_opts(argc, argv, &af, &rflags, NULL, true);
139 p_rttables(af, flags, rflags, interesting); 141 p_rttables(af, flags, rflags, interesting);
140} 142}