Merge pull request #5160 from donaldsharp/7.2_bgp_backports

7.2 bgp backports
This commit is contained in:
Mark Stapp 2019-10-15 15:38:23 -04:00 committed by GitHub
commit fdf4ed925c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 11 deletions

View File

@ -576,7 +576,7 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
if (make_json) if (make_json)
json_object_array_add( json_object_array_add(
jseg_list, jseg_list,
json_object_new_int(seg->as[i])); json_object_new_int64(seg->as[i]));
len += snprintf(str_buf + len, str_size - len, "%u", len += snprintf(str_buf + len, str_size - len, "%u",
seg->as[i]); seg->as[i]);

View File

@ -109,7 +109,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
uint16_t type; uint16_t type;
struct rd_as rd_as; struct rd_as rd_as;
struct rd_ip rd_ip; struct rd_ip rd_ip;
struct prefix_rd prd; struct prefix_rd prd = {0};
mpls_label_t label = {0}; mpls_label_t label = {0};
afi_t afi; afi_t afi;
safi_t safi; safi_t safi;

View File

@ -1785,9 +1785,9 @@ int subgroup_announce_check(struct bgp_node *rn, struct bgp_path_info *pi,
/* Route map & unsuppress-map apply. */ /* Route map & unsuppress-map apply. */
if (ROUTE_MAP_OUT_NAME(filter) || (pi->extra && pi->extra->suppress)) { if (ROUTE_MAP_OUT_NAME(filter) || (pi->extra && pi->extra->suppress)) {
struct bgp_path_info rmap_path; struct bgp_path_info rmap_path = {0};
struct bgp_path_info_extra dummy_rmap_path_extra; struct bgp_path_info_extra dummy_rmap_path_extra = {0};
struct attr dummy_attr; struct attr dummy_attr = {0};
memset(&rmap_path, 0, sizeof(struct bgp_path_info)); memset(&rmap_path, 0, sizeof(struct bgp_path_info));
rmap_path.peer = peer; rmap_path.peer = peer;
@ -3927,12 +3927,16 @@ static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi,
if (ain->peer != peer) if (ain->peer != peer)
continue; continue;
struct bgp_path_info *pi = struct bgp_path_info *pi;
bgp_node_get_bgp_path_info(rn);
uint32_t num_labels = 0; uint32_t num_labels = 0;
mpls_label_t *label_pnt = NULL; mpls_label_t *label_pnt = NULL;
struct bgp_route_evpn evpn; struct bgp_route_evpn evpn;
for (pi = bgp_node_get_bgp_path_info(rn); pi;
pi = pi->next)
if (pi->peer == peer)
break;
if (pi && pi->extra) if (pi && pi->extra)
num_labels = pi->extra->num_labels; num_labels = pi->extra->num_labels;
if (num_labels) if (num_labels)

View File

@ -2179,8 +2179,8 @@ static struct bgp_path_info *rfapiItBiIndexSearch(
{ {
struct skiplist *sl; struct skiplist *sl;
int rc; int rc;
struct bgp_path_info bpi_fake; struct bgp_path_info bpi_fake = {0};
struct bgp_path_info_extra bpi_extra; struct bgp_path_info_extra bpi_extra = {0};
struct bgp_path_info *bpi_result; struct bgp_path_info *bpi_result;
sl = RFAPI_RDINDEX(rn); sl = RFAPI_RDINDEX(rn);

View File

@ -773,8 +773,18 @@ int prefix_cmp(union prefixconstptr up1, union prefixconstptr up2)
if (i) if (i)
return i; return i;
return numcmp(pp1[offset] & maskbit[shift], /*
pp2[offset] & maskbit[shift]); * At this point offset was the same, if we have shift
* that means we still have data to compare, if shift is
* 0 then we are at the end of the data structure
* and should just return, as that we will be accessing
* memory beyond the end of the party zone
*/
if (shift)
return numcmp(pp1[offset] & maskbit[shift],
pp2[offset] & maskbit[shift]);
return 0;
} }
/* /*