mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
routing: do not allow PINNED routes to be overriden
First configured PINNED routes should have higher priority.
Fixes: 1da4954c92
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D48650
This commit is contained in:
1 parent
420e2f8a74
commit
361a8395f0
1 file changed
+1
-1
@@ -821,7 +821,7 @@ add_route_flags(struct rib_head *rnh, struct rtentry *rt, struct route_nhop_data
|
||||
|
||||
/* Now either append or replace */
|
||||
if (op_flags & RTM_F_REPLACE) {
|
||||
if (nhop_get_prio(rnd_orig.rnd_nhop) > nhop_get_prio(rnd_add->rnd_nhop)) {
|
||||
if (nhop_get_prio(rnd_orig.rnd_nhop) == NH_PRIORITY_HIGH) {
|
||||
/* Old path is "better" (e.g. has PINNED flag set) */
|
||||
RIB_WUNLOCK(rnh);
|
||||
error = EEXIST;
|
||||
|
||||
Reference in new issue
Block a user