summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-08 17:03:31 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-08 17:04:29 +0100
commitcc5b93f72db80abd1262a0a5e1d8400ceef54385 (patch)
tree42d75cb7898c6b6077e9cfbb04074cfc84e38930 /proto/bgp/packets.c
parent5de0e848de06a9187046dbc380d9ce6a6f8b21a2 (diff)
parentf51b1f556595108d53b9f4580bfcb96bfbc85442 (diff)
Merge tag 'v1.6.2' into int-new
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 72ca3728..0cf38edf 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -369,7 +369,7 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
}
put_u16(buf, wd_size);
- if (remains >= 3072)
+ if (!wd_size)
{
while ((buck = (struct bgp_bucket *) HEAD(p->bucket_queue))->send_node.next)
{
@@ -382,7 +382,7 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
}
DBG("Processing bucket %p\n", buck);
- a_size = bgp_encode_attrs(p, w+2, buck->eattrs, 2048);
+ a_size = bgp_encode_attrs(p, w+2, buck->eattrs, remains - 1024);
if (a_size < 0)
{
@@ -461,8 +461,7 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
w += size;
remains -= size;
}
-
- if (remains >= 3072)
+ else
{
while ((buck = (struct bgp_bucket *) HEAD(p->bucket_queue))->send_node.next)
{
@@ -478,7 +477,7 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
rem_stored = remains;
w_stored = w;
- size = bgp_encode_attrs(p, w, buck->eattrs, 2048);
+ size = bgp_encode_attrs(p, w, buck->eattrs, remains - 1024);
if (size < 0)
{
log(L_ERR "%s: Attribute list too long, skipping corresponding routes", p->p.name);