diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-03-20 14:05:44 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-06 13:22:43 -0400 |
| commit | e042a421d143b0e8fb360fa22c00718aea9f49a8 (patch) | |
| tree | b41b36f1245a756ca86aa24f1b252b3216f10138 | |
| parent | b13e5ad68a740b66c921c5ab1314e0898f0ed310 (diff) | |
pbrd: Only allow one nexthop group or nexthop at a time
When we are entering 'set nexthop' and 'set nexthop-group'
ensure that the cli only allows one of these to happen
at a time.
Ticket: CM-20125
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | pbrd/pbr_vty.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index 042d940646..77e4e3b6fa 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -143,6 +143,12 @@ DEFPY(pbr_map_nexthop_group, pbr_map_nexthop_group_cmd, struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence); struct nexthop_group_cmd *nhgc; + if (pbrms->nhg) { + vty_out(vty, + "A `set nexthop XX` command already exists, please remove that first\n"); + return CMD_WARNING; + } + nhgc = nhgc_find(name); if (!nhgc) { vty_out(vty, "Specified nexthop-group %s does not exist\n", |
