diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-05 16:38:21 +0200 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-05 16:38:21 +0200 |
commit | 1bfee9368adcd91337b4b4b5ad22330678ed0e78 (patch) | |
tree | 8c38a5231a85cf1a5c178531eac8ecc41bf2a350 /isisd/isis_redist.c | |
parent | Merge pull request #9714 from idryzhov/bgp-ext-comm-doc (diff) | |
download | frr-1bfee9368adcd91337b4b4b5ad22330678ed0e78.tar.xz frr-1bfee9368adcd91337b4b4b5ad22330678ed0e78.zip |
isisd: fix redistribute CLI
Currently, it is possible to configure IPv6 protocols for IPv4
redistribution and vice versa in CLI. The YANG model doesn't allow this
so the user receives the following error:
```
nfware(config-router)# redistribute ipv4 ospf6 level-1
% Failed to edit configuration.
YANG error(s):
Invalid enumeration value "ospf6".
Invalid enumeration value "ospf6".
Invalid enumeration value "ospf6".
YANG path: Schema location /frr-isisd:isis/instance/redistribute/ipv4/protocol.
```
Let's make CLI more user-friendly and allow only supported protocols in
redistribution commands.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'isisd/isis_redist.c')
-rw-r--r-- | isisd/isis_redist.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c index 2f5e490da..45d69bc35 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -543,12 +543,13 @@ void isis_redist_area_finish(struct isis_area *area) #ifdef FABRICD DEFUN (isis_redistribute, isis_redistribute_cmd, - "redistribute <ipv4|ipv6> " PROTO_REDIST_STR + "redistribute <ipv4 " PROTO_IP_REDIST_STR "|ipv6 " PROTO_IP6_REDIST_STR ">" " [{metric (0-16777215)|route-map WORD}]", REDIST_STR "Redistribute IPv4 routes\n" + PROTO_IP_REDIST_HELP "Redistribute IPv6 routes\n" - PROTO_REDIST_HELP + PROTO_IP6_REDIST_HELP "Metric for redistributed routes\n" "ISIS default metric\n" "Route map reference\n" @@ -599,12 +600,13 @@ DEFUN (isis_redistribute, DEFUN (no_isis_redistribute, no_isis_redistribute_cmd, - "no redistribute <ipv4|ipv6> " PROTO_REDIST_STR, + "no redistribute <ipv4 " PROTO_IP_REDIST_STR "|ipv6 " PROTO_IP6_REDIST_STR ">", NO_STR REDIST_STR "Redistribute IPv4 routes\n" + PROTO_IP_REDIST_HELP "Redistribute IPv6 routes\n" - PROTO_REDIST_HELP) + PROTO_IP6_REDIST_HELP) { int idx_afi = 2; int idx_protocol = 3; |