]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Do not allow setting `set distance` via route-maps to zero
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 21 Mar 2023 20:08:16 +0000 (22:08 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 21 Mar 2023 20:09:50 +0000 (22:09 +0200)
It's not allowed to install routes with zero distance, let's disallow this
for route-maps as well.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_routemap.c
doc/user/routemap.rst
yang/frr-bgp-route-map.yang

index b7bef75123b29760eca3fd36988dc542271d8db9..fa9d23874c8ecf1a9160234b23d7284434011225 100644 (file)
@@ -5512,7 +5512,7 @@ DEFUN_YANG (set_ip_nexthop_unchanged,
 
 DEFUN_YANG (set_distance,
            set_distance_cmd,
-           "set distance (0-255)",
+           "set distance (1-255)",
            SET_STR
            "BGP Administrative Distance to use\n"
            "Distance value\n")
@@ -5531,7 +5531,7 @@ DEFUN_YANG (set_distance,
 
 DEFUN_YANG (no_set_distance,
            no_set_distance_cmd,
-           "no set distance [(0-255)]",
+           "no set distance [(1-255)]",
            NO_STR SET_STR
            "BGP Administrative Distance to use\n"
            "Distance value\n")
index c205122b0b98f5ea0fd8929eec5bc692c2745d03..9e4d7a611aced3268fad9dff21a664ca47889a02 100644 (file)
@@ -294,9 +294,9 @@ Route Map Set Command
 
    Subtract the BGP local preference from an existing `local_pref`.
 
-.. clicmd:: set distance DISTANCE
+.. clicmd:: set distance (1-255)
 
-   Set the Administrative distance to DISTANCE to use for the route.
+   Set the Administrative distance to use for the route.
    This is only locally significant and will not be dispersed to peers.
 
 .. clicmd:: set weight WEIGHT
index 90163f125e26437b2625d173f0f23e2fb4828129..666f2bb23561e73adf1dd477d5367e860964769b 100644 (file)
@@ -760,7 +760,7 @@ module frr-bgp-route-map {
       when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:distance')";
       leaf distance {
         type uint8 {
-          range "0..255";
+          range "1..255";
         }
       }
     }