summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorG. Paul Ziemba <paulz@labn.net>2023-08-18 20:14:25 +0200
committerG. Paul Ziemba <paulz@labn.net>2023-08-18 20:14:25 +0200
commiteb3929b4faf8bfbc2f7a06782714fef9e5d0838b (patch)
tree41a3c1604feb4e2da187457ed4a0cebdc9889a40 /pbrd
parentpbrd: address 230815 coverity: pbr_vty.c pend/strtoul (diff)
downloadfrr-eb3929b4faf8bfbc2f7a06782714fef9e5d0838b.tar.xz
frr-eb3929b4faf8bfbc2f7a06782714fef9e5d0838b.zip
pbrd: address 230815 coverity: pbr_vty.c pbrms
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_vty.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index 9643fb955..c20d7a5b5 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -790,6 +790,9 @@ DEFPY (pbr_map_action_src_port,
/* clang-format on */
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
+ if (!pbrms)
+ return CMD_WARNING_CONFIG_FAILED;
+
if (no) {
if (!CHECK_FLAG(pbrms->action_bm, PBR_ACTION_SRC_PORT))
return CMD_SUCCESS;
@@ -821,6 +824,9 @@ DEFPY (pbr_map_action_dst_port,
/* clang-format on */
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
+ if (!pbrms)
+ return CMD_WARNING_CONFIG_FAILED;
+
if (no) {
if (!CHECK_FLAG(pbrms->action_bm, PBR_ACTION_DST_PORT))
return CMD_SUCCESS;
@@ -851,6 +857,9 @@ DEFPY (pbr_map_action_dscp,
/* clang-format on */
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
+ if (!pbrms)
+ return CMD_WARNING_CONFIG_FAILED;
+
if (no) {
if (!CHECK_FLAG(pbrms->action_bm, PBR_ACTION_DSCP))
return CMD_SUCCESS;
@@ -898,6 +907,9 @@ DEFPY (pbr_map_action_ecn,
/* clang-format on */
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
+ if (!pbrms)
+ return CMD_WARNING_CONFIG_FAILED;
+
if (no) {
if (!CHECK_FLAG(pbrms->action_bm, PBR_ACTION_ECN))
return CMD_SUCCESS;