Skip to content

Commit

Permalink
bgpd : Fix for multi-path test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
bisdhdh committed Oct 22, 2019
1 parent 801554d commit c085b7d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/bgpd/test_mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,22 @@ struct bgp_node test_rn;
static int setup_bgp_path_info_mpath_update(testcase_t *t)
{
int i;
struct bgp *bgp;
struct bgp_table *rt;
as_t asn = 1;

t->tmp_data = bgp_create_fake(&asn, NULL);
if (!t->tmp_data)
return -1;

bgp = t->tmp_data;
rt = bgp->rib[AFI_IP][SAFI_UNICAST];

if (!rt)
return -1;

str2prefix("42.1.1.0/24", &test_rn.p);
bgp_node_to_rnode(&test_rn)->table = rt->route_table;
setup_bgp_mp_list(t);
for (i = 0; i < test_mp_list_info_count; i++)
bgp_path_info_add(&test_rn, &test_mp_list_info[i]);
Expand Down Expand Up @@ -352,7 +367,7 @@ static int cleanup_bgp_path_info_mpath_update(testcase_t *t)
for (i = 0; i < test_mp_list_peer_count; i++)
sockunion_free(test_mp_list_peer[i].su_remote);

return 0;
return bgp_delete((struct bgp *)t->tmp_data);
}

testcase_t test_bgp_path_info_mpath_update = {
Expand Down

0 comments on commit c085b7d

Please sign in to comment.