]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Merge branch 'master' into evpn-bugs
authorMitesh Kanjariya <mitesh@cumulusnetworks.com>
Tue, 27 Feb 2018 10:00:10 +0000 (02:00 -0800)
committerGitHub <noreply@github.com>
Tue, 27 Feb 2018 10:00:10 +0000 (02:00 -0800)
1  2 
bgpd/bgp_evpn.c
bgpd/bgp_evpn_private.h
bgpd/bgp_evpn_vty.c

diff --cc bgpd/bgp_evpn.c
Simple merge
index 54e9b014cf4c3a6b408760ba75d135111fd86a13,1dbc1f25f00d8709f3d7dfead71c75ad450b247c..5d59ed5ae65c2e1048d8485c5ca23fae86a63847
@@@ -61,9 -61,9 +61,11 @@@ struct bgpevpn 
  #define VNI_FLAG_RD_CFGD           0x4  /* RD is user configured. */
  #define VNI_FLAG_IMPRT_CFGD        0x8  /* Import RT is user configured */
  #define VNI_FLAG_EXPRT_CFGD        0x10 /* Export RT is user configured */
+ #define VNI_FLAG_USE_TWO_LABELS    0x20 /* Attach both L2-VNI and L3-VNI if
+                                          needed for this VPN */
  
 +      struct bgp *bgp_vrf; /* back pointer to the vrf instance */
 +
        /* Flag to indicate if we are advertising the g/w mac ip for this VNI*/
        u_int8_t advertise_gw_macip;
  
@@@ -163,31 -178,33 +165,37 @@@ static inline struct list *bgpevpn_get_
  
  static inline void bgpevpn_unlink_from_l3vni(struct bgpevpn *vpn)
  {
 -      struct bgp *bgp_vrf = NULL;
 -
 -      bgp_vrf = bgp_lookup_by_vrf_id(vpn->tenant_vrf_id);
 -      if (!bgp_vrf)
 +      /* bail if vpn is not associated to bgp_vrf */
 +      if (!vpn->bgp_vrf)
                return;
--
++  
+       UNSET_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS);
 -
 -      if (bgp_vrf->l2vnis)
 -              listnode_delete(bgp_vrf->l2vnis, vpn);
 +      listnode_delete(vpn->bgp_vrf->l2vnis, vpn);
++  
 +      /* remove the backpointer to the vrf instance */
 +      vpn->bgp_vrf = NULL;
  }
  
  static inline void bgpevpn_link_to_l3vni(struct bgpevpn *vpn)
  {
        struct bgp *bgp_vrf = NULL;
  
 +      /* bail if vpn is already associated to vrf */
 +      if (vpn->bgp_vrf)
 +              return;
 +
        bgp_vrf = bgp_lookup_by_vrf_id(vpn->tenant_vrf_id);
-       if (!bgp_vrf || !bgp_vrf->l2vnis)
+       if (!bgp_vrf)
                return;
  
 -
 -      if (bgp_vrf->l2vnis)
 -              listnode_add_sort(bgp_vrf->l2vnis, vpn);
 +      /* associate the vpn to the bgp_vrf instance */
 +      vpn->bgp_vrf = bgp_vrf;
 +      listnode_add_sort(bgp_vrf->l2vnis, vpn);
++
+       /* check if we are advertising two labels for this vpn */
+       if (!CHECK_FLAG(bgp_vrf->vrf_flags,
+                      BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY))
+               SET_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS);
  }
  
  static inline int is_vni_configured(struct bgpevpn *vpn)
Simple merge