Skip to content

Commit

Permalink
Merge pull request #527 from LabNConsulting/working/master/patch-set/…
Browse files Browse the repository at this point in the history
…issue471+473

Master: Restore label distribution for VPN safi
  • Loading branch information
donaldsharp authored May 15, 2017
2 parents 36a9639 + 0918e87 commit 59371d4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
3 changes: 2 additions & 1 deletion bgpd/bgp_label.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ extern int bgp_nlri_parse_label (struct peer *peer, struct attr *attr,
static inline int
bgp_labeled_safi (safi_t safi)
{
if ((safi == SAFI_LABELED_UNICAST) || (safi == SAFI_MPLS_VPN))
if ((safi == SAFI_LABELED_UNICAST) || (safi == SAFI_MPLS_VPN) ||
(safi == SAFI_EVPN))
return 1;
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ subgroup_announce_check (struct bgp_node *rn, struct bgp_info *ri,
}

/* If it's labeled safi, make sure the route has a valid label. */
if (bgp_labeled_safi(safi))
if (safi == SAFI_LABELED_UNICAST)
{
u_char *tag = bgp_adv_label(rn, ri, peer, afi, safi);
if (!bgp_is_valid_label(tag))
Expand Down Expand Up @@ -1941,9 +1941,9 @@ bgp_process_main (struct work_queue *wq, void *data)
* Right now, since we only deal with per-prefix labels, it is not necessary
* to do this upon changes to best path except of the label index changes.
*/
bgp_table_lock (bgp_node_table (rn));
if (bgp_labeled_safi (safi))
if (safi == SAFI_LABELED_UNICAST)
{
bgp_table_lock (bgp_node_table (rn));
if (new_select)
{
if (!old_select ||
Expand Down Expand Up @@ -2848,7 +2848,7 @@ bgp_update (struct peer *peer, struct prefix *p, u_int32_t addpath_id,
new = info_make(type, sub_type, 0, peer, attr_new, rn);

/* Update MPLS tag. */
if (bgp_labeled_safi(safi) || safi == SAFI_EVPN)
if (bgp_labeled_safi(safi))
memcpy ((bgp_info_extra_get (new))->tag, tag, 3);

/* Update Overlay Index */
Expand Down
13 changes: 2 additions & 11 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

static struct peer_group *
listen_range_exists (struct bgp *bgp, struct prefix *range, int exact);
#if 0
#define INSTALL_CMD_ON_AF_NODES(cmd) \
install_element(BGP_IPV4_NODE, cmd); \
install_element(BGP_IPV4M_NODE, cmd); \
install_element(BGP_IPV4L_NODE, cmd); \
install_element(BGP_IPV6_NODE, cmd); \
install_element(BGP_IPV6M_NODE, cmd); \
install_element(BGP_IPV6L_NODE, cmd); \
install_element(BGP_VPNV4_NODE, cmd);
#endif

static enum node_type
bgp_node_type (afi_t afi, safi_t safi)
{
Expand Down Expand Up @@ -111,7 +102,7 @@ bgp_node_type (afi_t afi, safi_t safi)
return BGP_VPNV6_NODE;
break;
case SAFI_ENCAP:
return BGP_ENCAP_NODE;
return BGP_ENCAPV6_NODE;
break;
}
break;
Expand Down
1 change: 1 addition & 0 deletions bgpd/rfapi/rfapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,7 @@ add_vnc_route (
bgp, prd, table, p, new);
}
bgp_unlock_node (prn);
encode_label (label_val, bn->local_label);
}

bgp_unlock_node (bn);
Expand Down

0 comments on commit 59371d4

Please sign in to comment.