From: Donald Sharp Date: Fri, 9 Oct 2020 00:36:22 +0000 (-0400) Subject: lib: Relax usage of `ip prefix-list A.B.C.D/M ge Y` X-Git-Tag: frr-7.5~4^2~29 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=753dce875eac0648740952a7fcb20485bee9568b;p=mirror%2Ffrr.git lib: Relax usage of `ip prefix-list A.B.C.D/M ge Y` Currently the prefix length M must be less than Y. Relax this restriction to allow M to be less than or equal to Y. Signed-off-by: Donald Sharp --- diff --git a/lib/filter_nb.c b/lib/filter_nb.c index b253743db8..1d522bdbec 100644 --- a/lib/filter_nb.c +++ b/lib/filter_nb.c @@ -77,11 +77,11 @@ static enum nb_error prefix_list_length_validate(struct nb_cb_modify_args *args) /* * Check rule: - * prefix length < ge. + * prefix length <= ge. */ if (yang_dnode_exists(args->dnode, xpath_ge)) { ge = yang_dnode_get_uint8(args->dnode, xpath_ge); - if (p.prefixlen >= ge) + if (p.prefixlen > ge) goto log_and_fail; } @@ -102,7 +102,7 @@ static enum nb_error prefix_list_length_validate(struct nb_cb_modify_args *args) log_and_fail: snprintfrr( args->errmsg, args->errmsg_len, - "Invalid prefix range for %pFX: Make sure that mask length < ge <= le", + "Invalid prefix range for %pFX: Make sure that mask length <= ge <= le", &p); return NB_ERR_VALIDATION; }