]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: fix display of encap routes in the running configuration
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 May 2017 19:51:46 +0000 (16:51 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 20 May 2017 17:06:45 +0000 (13:06 -0400)
Static encap routes don't have an MPLS label. Also, use %u instead of
%d to print the label.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/bgp_route.c

index 5c157b95393377340aea310cc1dd1aca46ba28e0..13279f89b1365fb358c43af778ab8d6f5b995fff 100644 (file)
@@ -10434,10 +10434,12 @@ bgp_config_write_network_vpn (struct vty *vty, struct bgp *bgp,
            prefix_rd2str (prd, rdbuf, RD_ADDRSTRLEN);
            label = decode_label (bgp_static->tag);
 
-           vty_out (vty, "  network %s/%d rd %s label %d",
+           vty_out (vty, "  network %s/%d rd %s",
                     inet_ntop (p->family, &p->u.prefix, buf, SU_ADDRSTRLEN), 
-                    p->prefixlen,
-                    rdbuf, label);
+                    p->prefixlen, rdbuf);
+           if (safi == SAFI_MPLS_VPN)
+             vty_out (vty, " label %u", label);
+
             if (bgp_static->rmap.name)
               vty_out (vty, " route-map %s", bgp_static->rmap.name);
             else