mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 05:28:51 +00:00
tests: Fix crash in test_mp_attr
Some recent changes in BGP now require that the peer's nexthop have a valid ifp when we are looking at: case BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL: case BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL: This assumption makes sense for this type of Nexthop Attribute. So for the test let's jimmy up a `fake` enough interface pointer so that the actual test we can focus on what we are actually testing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
bb4f6190d9
commit
d0fa84c228
@ -1033,6 +1033,7 @@ static as_t asn = 100;
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
struct interface ifp;
|
||||||
struct peer *peer;
|
struct peer *peer;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -1065,6 +1066,9 @@ int main(void)
|
|||||||
peer->status = Established;
|
peer->status = Established;
|
||||||
peer->curr = stream_new(BGP_MAX_PACKET_SIZE);
|
peer->curr = stream_new(BGP_MAX_PACKET_SIZE);
|
||||||
|
|
||||||
|
ifp.ifindex = 0;
|
||||||
|
peer->nexthop.ifp = &ifp;
|
||||||
|
|
||||||
for (i = AFI_IP; i < AFI_MAX; i++)
|
for (i = AFI_IP; i < AFI_MAX; i++)
|
||||||
for (j = SAFI_UNICAST; j < SAFI_MAX; j++) {
|
for (j = SAFI_UNICAST; j < SAFI_MAX; j++) {
|
||||||
peer->afc[i][j] = 1;
|
peer->afc[i][j] = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user