From 281be8f97bb81dd8ed610b620f4af8bf501e2969 Mon Sep 17 00:00:00 2001 From: benno Date: Sat, 14 Jul 2018 13:37:44 +0000 Subject: [PATCH] Make route monitor display changes in all routing domains by forcing the route filter to set RTABLE_ANY. Previously only the routing table/rdomain of the route process was displayed (that being the kernel default). ok kn@ claudio@ and henning@ --- sbin/route/route.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sbin/route/route.c b/sbin/route/route.c index b61b484641d..115eae2c1ee 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.221 2018/07/13 09:19:42 schwarze Exp $ */ +/* $OpenBSD: route.c,v 1.222 2018/07/14 13:37:44 benno Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -150,6 +150,7 @@ main(int argc, char **argv) int kw; int Terr = 0; int af = AF_UNSPEC; + u_int rtable_any = RTABLE_ANY; if (argc < 2) usage(NULL); @@ -231,10 +232,15 @@ main(int argc, char **argv) } /* force socket onto table user requested */ - if (Tflag == 1 && Terr == 0 && - setsockopt(s, AF_ROUTE, ROUTE_TABLEFILTER, - &tableid, sizeof(tableid)) == -1) - err(1, "setsockopt(ROUTE_TABLEFILTER)"); + if (Tflag == 1 && Terr == 0) { + if (setsockopt(s, AF_ROUTE, ROUTE_TABLEFILTER, + &tableid, sizeof(tableid)) == -1) + err(1, "setsockopt(ROUTE_TABLEFILTER)"); + } else { + if (setsockopt(s, AF_ROUTE, ROUTE_TABLEFILTER, + &rtable_any, sizeof(tableid)) == -1) + err(1, "setsockopt(ROUTE_TABLEFILTER)"); + } if (pledge("stdio dns route", NULL) == -1) err(1, "pledge"); -- 2.20.1