From b8eb036fb289df03190f0a88dbee2431d21c0d55 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 22 Mar 2018 13:25:20 -0400 Subject: [PATCH] pbrd: If we get the same prefix safely ignore If the match src-ip or dst-ip command entered has already been received and it's the same prefix, we are done and do not need to do anything more. Signed-off-by: Donald Sharp --- pbrd/pbr_vty.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index 0e66c39706..c8c3ed3302 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -96,6 +96,9 @@ DEFPY(pbr_map_match_src, pbr_map_match_src_cmd, struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence); if (!no) { + if (prefix_same(pbrms->src, prefix)) + return CMD_SUCCESS; + if (!pbrms->src) pbrms->src = prefix_new(); prefix_copy(pbrms->src, prefix); @@ -120,6 +123,9 @@ DEFPY(pbr_map_match_dst, pbr_map_match_dst_cmd, struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence); if (!no) { + if (prefix_same(pbrms->dst, prefix)) + return CMD_SUCCESS; + if (!pbrms->dst) pbrms->dst = prefix_new(); prefix_copy(pbrms->dst, prefix); -- 2.39.5