]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: show running-config displays also srgb on some cases
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 16 Feb 2022 16:26:53 +0000 (17:26 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 Mar 2022 14:18:34 +0000 (15:18 +0100)
The following configuration:
router ospf
 segment-routing global-block 16000 23999 local-block 1000 2000
!

appears in the 'show running-config' like below:

router ospf
 local-block 1000 2000
!

When there are custom Adjacencies, display the SRGB even if SRGB
has the default settings.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
ospfd/ospf_sr.c

index 21978d35ce268a19de422eb5035895ec5387158c..b5dbc4a5a9350dd0ae923cdb6667165e55a6a38e 100644 (file)
@@ -2053,11 +2053,15 @@ void ospf_sr_config_write_router(struct vty *vty)
                vty_out(vty, " segment-routing global-block %u %u",
                        OspfSR.srgb.start, upper);
 
-       if ((OspfSR.srlb.start != DEFAULT_SRLB_LABEL)
-           || (OspfSR.srlb.end != DEFAULT_SRLB_END))
+       if ((OspfSR.srlb.start != DEFAULT_SRLB_LABEL) ||
+           (OspfSR.srlb.end != DEFAULT_SRLB_END)) {
+               if ((OspfSR.srgb.start == DEFAULT_SRGB_LABEL) &&
+                   (OspfSR.srgb.size == DEFAULT_SRGB_SIZE))
+                       vty_out(vty, " segment-routing global-block %u %u",
+                               OspfSR.srgb.start, upper);
                vty_out(vty, " local-block %u %u\n", OspfSR.srlb.start,
                        OspfSR.srlb.end);
-       else
+       else
                vty_out(vty, "\n");
 
        if (OspfSR.msd != 0)