summaryrefslogtreecommitdiffstats
path: root/tests/aspath_test.c
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2012-03-23 12:15:00 +0000
committerChris Hall <chris.hall@highwayman.com>2012-03-23 12:15:00 +0000
commit4526b03b4c1ac32588cd8f9a3ea71bafe72db9ef (patch)
tree48c05781305667727e1dcd2207df6c25976bb488 /tests/aspath_test.c
parent97f375b3e02e0f4ec18f68fbe36fc5ae16693d26 (diff)
parentaee567450eaf32877d00f47c4cc5d05c5fb85a51 (diff)
downloadquagga-ex23b.tar.bz2
quagga-ex23b.tar.xz
Merge branch 'master' into euro_ix_bex23b
v0.99.20ex23b -- Quagga 'master' as at 23-Mar-2012 Conflicts: bgpd/bgp_attr.c bgpd/bgp_attr.h Difference between 'master' and 0.99.20.1 is in these files. Handling of attributes has been worked over again to common up checks of the flags, and to use a common parsing structure, which reduces the clutter of parameters for the individual attribute parsing functions. bgpd/bgp_open.c bgpd/bgp_packet.c lib/thread.c ospfd/ospf_packet.c These were artifacts, caused by common patches in master and 0.99.20.1 -- and some twitchy-ness about whitespace !
Diffstat (limited to 'tests/aspath_test.c')
-rw-r--r--tests/aspath_test.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/aspath_test.c b/tests/aspath_test.c
index 96cc5464..5b6de518 100644
--- a/tests/aspath_test.c
+++ b/tests/aspath_test.c
@@ -1197,13 +1197,12 @@ handle_attr_test (struct aspath_tests *t)
{
struct bgp bgp = { 0 };
struct peer peer = { 0 };
- struct attr attr = { 0 };
int ret;
int initfail = failed;
struct aspath *asp;
size_t datalen, endp;
char host[] = { "none" } ;
- bool mp_eor ;
+ bgp_attr_parser_args_t args[1] ;
asp = make_aspath (t->segment->asdata, t->segment->len, 0);
@@ -1216,12 +1215,17 @@ handle_attr_test (struct aspath_tests *t)
#endif
peer.cap = t->cap;
+ memset (args, 0, sizeof (args));
+
+ args->peer = &peer ;
+ args->s = peer.ibuf ;
+
stream_put (peer.ibuf, t->attrheader, t->len);
datalen = aspath_put (peer.ibuf, asp, t->as4 == AS4_DATA);
endp = stream_push_endp(peer.ibuf, t->len + datalen) ;
- ret = bgp_attr_parse (&peer, &attr, NULL, NULL, &mp_eor);
+ ret = bgp_attr_parse (args);
if (ret != t->result)
{
@@ -1232,23 +1236,24 @@ handle_attr_test (struct aspath_tests *t)
if (ret != 0)
goto out;
- if (attr.aspath == NULL)
+ if (args->attr.aspath == NULL)
{
printf ("aspath is NULL!\n");
failed++;
}
- if (attr.aspath && strcmp (attr.aspath->str, t->shouldbe))
+
+ if (args->attr.aspath && strcmp (args->attr.aspath->str, t->shouldbe))
{
printf ("attr str and 'shouldbe' mismatched!\n"
"attr str: %s\n"
"shouldbe: %s\n",
- attr.aspath->str, t->shouldbe);
+ args->attr.aspath->str, t->shouldbe);
failed++;
}
out:
- if (attr.aspath)
- aspath_unintern (&attr.aspath);
+ if (args->attr.aspath)
+ aspath_unintern (&args->attr.aspath);
if (asp)
aspath_unintern (&asp);
return failed - initfail;