summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-08-22 12:16:01 -0400
committerGitHub <noreply@github.com>2023-08-22 12:16:01 -0400
commit58ade1ba5d1fb5b5b6565ba7552993493d93e395 (patch)
tree8846cee0f2685e62389497711dd5dd7385ae9dc8
parent020d8488cf2c96136e783f0b2fe906bd864548c1 (diff)
parentd04cf8052556340946a2c48ddc5a4c85db468503 (diff)
Merge pull request #14217 from LabNConsulting/ziemba-pbr-action-drop
pbrd: add advisory flag PBR_ACTION_DROP
-rw-r--r--lib/pbr.h1
-rw-r--r--pbrd/pbr_vty.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/pbr.h b/lib/pbr.h
index c514cc2a65..d8c06e75bd 100644
--- a/lib/pbr.h
+++ b/lib/pbr.h
@@ -99,6 +99,7 @@ struct pbr_action {
#define PBR_ACTION_DST_PORT (1 << 8)
#define PBR_ACTION_DSCP (1 << 9)
#define PBR_ACTION_ECN (1 << 10)
+#define PBR_ACTION_DROP (1 << 11) /* nexthop == blackhole */
uint32_t table;
uint32_t queue_id;
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index 1f1e42218f..6d31fd75ac 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -1118,6 +1118,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);
}
@@ -1276,6 +1279,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;
}