summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 26716573..4ae6c5cf 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -217,6 +217,7 @@ bgp_write_capabilities(struct bgp_conn *conn, byte *buf)
struct bgp_af_caps *ac;
uint any_ext_next_hop = 0;
uint any_add_path = 0;
+ byte *buf_head = buf;
byte *data;
/* Prepare bgp_caps structure */
@@ -394,6 +395,8 @@ bgp_write_capabilities(struct bgp_conn *conn, byte *buf)
data[-1] = buf - data;
}
+ caps->length = buf - buf_head;
+
return buf;
}
@@ -405,6 +408,8 @@ bgp_read_capabilities(struct bgp_conn *conn, struct bgp_caps *caps, byte *pos, i
int i, cl;
u32 af;
+ caps->length += len;
+
while (len > 0)
{
if (len < 2 || len < (2 + pos[1]))