]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: move route-target for a vrf under address-family evpn command
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Mon, 19 Feb 2018 09:39:48 +0000 (01:39 -0800)
committermitesh <mitesh@cumulusnetworks.com>
Tue, 27 Feb 2018 09:14:43 +0000 (01:14 -0800)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgp_evpn_vty.c
bgpd/bgpd.c

index 131bb82276d1e5826c7a09d5fe78a7033e97426f..db865adf11300e1a330def5b6558136c7168210f 100644 (file)
@@ -4393,6 +4393,38 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi,
 
        if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_ADVERTISE_IPV6_IN_EVPN))
                vty_out(vty, "  advertise ipv6 unicast\n");
+
+       /* import route-target */
+       if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_IMPORT_RT_CFGD)) {
+               char *ecom_str;
+               struct listnode *node, *nnode;
+               struct ecommunity *ecom;
+
+               for (ALL_LIST_ELEMENTS(bgp->vrf_import_rtl, node, nnode,
+                                      ecom)) {
+                       ecom_str = ecommunity_ecom2str(
+                               ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
+                       vty_out(vty, "   route-target import %s\n",
+                               ecom_str);
+                       XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
+               }
+       }
+
+       /* export route-target */
+       if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_EXPORT_RT_CFGD)) {
+               char *ecom_str;
+               struct listnode *node, *nnode;
+               struct ecommunity *ecom;
+
+               for (ALL_LIST_ELEMENTS(bgp->vrf_export_rtl, node, nnode,
+                                      ecom)) {
+                       ecom_str = ecommunity_ecom2str(
+                               ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
+                       vty_out(vty, "   route-target export %s\n",
+                               ecom_str);
+                       XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
+               }
+       }
 }
 
 void bgp_ethernetvpn_init(void)
index 78e748fb6c5d2c5765af9ee67f6121f8b838c9ee..de2b913056ce782257ee3e813ca1a56686ed58bf 100644 (file)
@@ -7315,38 +7315,6 @@ int bgp_config_write(struct vty *vty)
                if (bgp_option_check(BGP_OPT_CONFIG_CISCO))
                        vty_out(vty, " no auto-summary\n");
 
-               /* import route-target */
-               if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_IMPORT_RT_CFGD)) {
-                       char *ecom_str;
-                       struct listnode *node, *nnode;
-                       struct ecommunity *ecom;
-
-                       for (ALL_LIST_ELEMENTS(bgp->vrf_import_rtl, node, nnode,
-                                              ecom)) {
-                               ecom_str = ecommunity_ecom2str(
-                                       ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
-                               vty_out(vty, "   route-target import %s\n",
-                                       ecom_str);
-                               XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
-                       }
-               }
-
-               /* export route-target */
-               if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_EXPORT_RT_CFGD)) {
-                       char *ecom_str;
-                       struct listnode *node, *nnode;
-                       struct ecommunity *ecom;
-
-                       for (ALL_LIST_ELEMENTS(bgp->vrf_export_rtl, node, nnode,
-                                              ecom)) {
-                               ecom_str = ecommunity_ecom2str(
-                                       ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
-                               vty_out(vty, "   route-target export %s\n",
-                                       ecom_str);
-                               XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
-                       }
-               }
-
                /* IPv4 unicast configuration.  */
                bgp_config_write_family(vty, bgp, AFI_IP, SAFI_UNICAST);