summaryrefslogtreecommitdiff
path: root/pbrd
diff options
context:
space:
mode:
authorG. Paul Ziemba <paulz@labn.net>2023-08-13 13:55:06 -0700
committerG. Paul Ziemba <paulz@labn.net>2023-08-16 07:08:49 -0700
commitd04cf8052556340946a2c48ddc5a4c85db468503 (patch)
tree4f2bcb66b686988f5d70870275ee5ebae3114414 /pbrd
parentbd6a00e8f7ab48e6ab20673474c6eb1e879cb5c4 (diff)
pbrd: add advisory flag PBR_ACTION_DROP
PBR configuration may specify "set nexthop blackhole" which, for linux dataplanes, is implemented as a table with a blackhole route. Other dataplanes might implement this action as an explicit packet-filtering "drop" action instead of a route. This new flag PBR_ACTION_DROP is now set when a rule has "set nexthop blackhole" as an aid to other dataplanes. Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_vty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index 0d6e1afd5b..d0c20c80ca 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -1105,6 +1105,9 @@ static void pbrms_clear_set_config(struct pbr_map_sequence *pbrms)
pbrms->nhs_installed = false;
pbrms->forwarding_type = PBR_FT_UNSPEC;
+
+ /* clear advisory flag indicating nexthop == blackhole */
+ UNSET_FLAG(pbrms->action_bm, PBR_ACTION_DROP);
}
@@ -1263,6 +1266,8 @@ DEFPY (pbr_map_nexthop,
}
} else if (bh) {
nhop.type = NEXTHOP_TYPE_BLACKHOLE;
+ /* advisory flag for non-linux dataplanes */
+ SET_FLAG(pbrms->action_bm, PBR_ACTION_DROP);
} else {
nhop.type = NEXTHOP_TYPE_IFINDEX;
}