Skip to content

Commit

Permalink
netlink: restore the ability to delete PINNED routes
Browse files Browse the repository at this point in the history
route(8) had such ability before migration to netlink. To be able
to delete PINNED routes we pass RTM_F_FORCE to rib_del_route_px()
when userland uses RTF_PINNED flag with RTM_DELETE command.
This is hackish way for route(8) tool, that third-party software
usually doesn't use.

PR:		279988
Tested by:	franco at opnsense org
Discussed with:	glebius
MFC after:	10 days
Differential Revision:	https://reviews.freebsd.org/D46301
  • Loading branch information
bu7cher committed Jan 11, 2025
1 parent 3999a86 commit 3ce003c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sys/netlink/route/rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,8 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp,
}

error = rib_del_route_px(attrs.rta_table, attrs.rta_dst,
attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc);
attrs.rtm_dst_len, path_match_func, &attrs,
(attrs.rta_rtflags & RTF_PINNED) ? RTM_F_FORCE : 0, &rc);
if (error == 0)
report_operation(attrs.rta_table, &rc, nlp, hdr);
return (error);
Expand Down

0 comments on commit 3ce003c

Please sign in to comment.