summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-08-22 18:16:01 +0200
committerGitHub <noreply@github.com>2023-08-22 18:16:01 +0200
commit58ade1ba5d1fb5b5b6565ba7552993493d93e395 (patch)
tree8846cee0f2685e62389497711dd5dd7385ae9dc8
parentMerge pull request #14214 from opensourcerouting/fix/handle_rfc7606_attr_len_... (diff)
parentpbrd: add advisory flag PBR_ACTION_DROP (diff)
downloadfrr-58ade1ba5d1fb5b5b6565ba7552993493d93e395.tar.xz
frr-58ade1ba5d1fb5b5b6565ba7552993493d93e395.zip
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 c514cc2a6..d8c06e75b 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 1f1e42218..6d31fd75a 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;
}