]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: Use BGP Extended Message length
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Thu, 25 Feb 2021 17:44:15 +0000 (19:44 +0200)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Wed, 3 Mar 2021 20:21:08 +0000 (22:21 +0200)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
tests/bgpd/test_aspath.c
tests/bgpd/test_capability.c
tests/bgpd/test_mp_attr.c

index 936ffaaad58d4ec96605e4955d147e51a0a74767..1a9183c472af50af3d93ffca063a813fa685e0fb 100644 (file)
@@ -892,7 +892,7 @@ static int validate(struct aspath *as, const struct test_spec *sp)
 
        /* Excercise AS4 parsing a bit, with a dogfood test */
        if (!s)
-               s = stream_new(4096);
+               s = stream_new(BGP_MAX_EXTENDED_MESSAGE_PACKET_SIZE);
        bytes4 = aspath_put(s, as, 1);
        as4 = make_aspath(STREAM_DATA(s), bytes4, 1);
 
@@ -1201,12 +1201,13 @@ static int handle_attr_test(struct aspath_tests *t)
 
        asp = make_aspath(t->segment->asdata, t->segment->len, 0);
 
-       peer.curr = stream_new(BGP_MAX_PACKET_SIZE);
+       peer.curr = stream_new(BGP_MAX_EXTENDED_MESSAGE_PACKET_SIZE);
        peer.obuf = stream_fifo_new();
        peer.bgp = &bgp;
        peer.host = (char *)"none";
        peer.fd = -1;
        peer.cap = t->cap;
+       peer.max_packet_size = BGP_MAX_PACKET_SIZE;
 
        stream_write(peer.curr, t->attrheader, t->len);
        datalen = aspath_put(peer.curr, asp, t->as4 == AS4_DATA);
index 153b83897d988b3ed11a76656e43b356a1e8959c..91c0cce80c5e2f2ffc46a060363bcf6c1227b24f 100644 (file)
@@ -935,7 +935,7 @@ int main(void)
                        peer->afc_adv[i][j] = 1;
                }
 
-       peer->curr = stream_new(BGP_MAX_PACKET_SIZE);
+       peer->curr = stream_new(BGP_MAX_EXTENDED_MESSAGE_PACKET_SIZE);
 
        i = 0;
        while (mp_segments[i].name)
index f51076091357f83cd4083a658d6a14959ff0eab3..8de0604c45185fb84c6765225e9590bf286e547a 100644 (file)
@@ -1100,7 +1100,7 @@ int main(void)
        peer = peer_create_accept(bgp);
        peer->host = (char *)"foo";
        peer->status = Established;
-       peer->curr = stream_new(BGP_MAX_PACKET_SIZE);
+       peer->curr = stream_new(BGP_MAX_EXTENDED_MESSAGE_PACKET_SIZE);
 
        ifp.ifindex = 0;
        peer->nexthop.ifp = &ifp;