summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
authorNasato Goto <goto@mfeed.ad.jp>2020-04-15 03:46:53 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2020-04-15 03:46:53 +0200
commita6548d5b5be1d0186dfab43b76790803f8c8625e (patch)
tree19362cce5fbe5ad84ad764ca1ce2a6e1be804f3a /proto/bgp/attrs.c
parentfd9f0c0640fd02a26b96b4f9d3cbbffbb6544a84 (diff)
BGP: Fix handling of 16bit-only ASN translation
The bug generated invalid AGGREGATOR attribute during translation of 32bit ASN to 16bit-only BGP peer. The patch fixes that.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 39297dd7..655ddb62 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -577,6 +577,7 @@ bgp_encode_aggregator(struct bgp_write_state *s, eattr *a, byte *buf, uint size)
/* Prepare 16-bit AGGREGATOR (from 32-bit one) in a temporary buffer */
byte *dst = alloca(6);
len = aggregator_32to16(dst, data);
+ data = dst;
}
return bgp_put_attr(buf, size, BA_AGGREGATOR, a->flags, data, len);