The bug generated invalid AGGREGATOR attribute during translation of
32bit ASN to 16bit-only BGP peer. The patch fixes that.
aggregator_to_old(struct linpool *pool, const struct adata *a)
{
struct adata *d = lp_alloc_adata(pool, 8);
- put_u32(d->data, 0xFFFF);
+ put_u32(d->data, AS_TRANS);
memcpy(d->data + 4, a->data + 4, 4);
return d;
}
/* 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);