diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2026-05-29 16:44:09 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2026-05-29 22:18:20 +0000 |
| commit | 32a7ba251acbfb442665eed40fb4f48c8f2bd710 (patch) | |
| tree | 019aeab8f135dcb0f6a56a2a389d483af6ac11a1 | |
| parent | b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0 (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
| -rw-r--r-- | sbin/route/route_netlink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c index 051662688047..0d4420767082 100644 --- a/sbin/route/route_netlink.c +++ b/sbin/route/route_netlink.c @@ -950,7 +950,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; |
