aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2026-05-29 16:44:09 +0000
committerEd Maste <emaste@FreeBSD.org>2026-06-09 13:02:22 +0000
commit2caaf8c1c717bcebf14832b4bea5766e393ad683 (patch)
tree8194c8d2551cd7a120b776f1bbeabc5762acbd2e
parent81b3a7991543e1cf2f279e474c9636f2a0ce2e6e (diff)
route: Fix `flush` w/o specified address family
PR: 291867 Reported by: gavin Reviewed by: pouria, melifaro Sponsored by: The FreeBSD Foundation Fixes: c597432e2297 ("route(8): convert to netlink") Differential Revision: https://reviews.freebsd.org/D57336 (cherry picked from commit 32a7ba251acbfb442665eed40fb4f48c8f2bd710)
-rw-r--r--sbin/route/route_netlink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c
index 5dde7501d6b4..74ebb99a9486 100644
--- a/sbin/route/route_netlink.c
+++ b/sbin/route/route_netlink.c
@@ -888,7 +888,8 @@ flushroutes_fib_nl(int fib, int af)
struct snl_msg_info attrs = {};
print_nlmsg(&h, hdr, &attrs);
}
- if (r.rta_table != (uint32_t)fib || r.rtm_family != af)
+ if (r.rta_table != (uint32_t)fib ||
+ (af != AF_UNSPEC && r.rtm_family != af))
continue;
if ((r.rta_rtflags & RTF_GATEWAY) == 0)
continue;