From 55251492d0ba8f802fd1050ff025d25867c6a314 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Tue, 25 Aug 2020 09:07:03 -0300 Subject: [PATCH] yang: fix cisco extended access list mistake The extended value must be a part of the cisco choice otherwise it will be possible to create a destination only part which will cause a crash when trying to access the assumed mandatory source. Signed-off-by: Rafael Zalamena --- yang/frr-filter.yang | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/yang/frr-filter.yang b/yang/frr-filter.yang index c9e09bef4b..1e44c2569e 100644 --- a/yang/frr-filter.yang +++ b/yang/frr-filter.yang @@ -170,31 +170,22 @@ module frr-filter { description "Match any"; type empty; } - } - choice extended-value { - /* - * Legacy note: before using the new access-list format the - * cisco styled list only accepted identifiers using numbers - * and they had the following restriction: - * - * when "../number >= 100 and ../number <= 199 or - * ../number >= 2000 and ../number <= 2699"; - */ - description "Destination value to match"; - mandatory true; - - leaf destination-host { - description "Host to match"; - type inet:ipv4-address; - } - leaf destination-network { - description "Network to match"; - type inet:ipv4-prefix; - } - leaf destination-any { - description "Match any"; - type empty; + choice extended-value { + description "Destination value to match"; + + leaf destination-host { + description "Host to match"; + type inet:ipv4-address; + } + leaf destination-network { + description "Network to match"; + type inet:ipv4-prefix; + } + leaf destination-any { + description "Match any"; + type empty; + } } } } -- 2.39.5