[bgp/attribute] Make sure cleared MP_UNREACH_NLRI attribute size is consistent when rebuilding RIBs

This commit is contained in:
Lorenzo Cogotti 2021-06-08 00:50:12 +02:00
parent ac6c224f72
commit 01c4311eb7
1 changed files with 3 additions and 1 deletions

View File

@ -341,7 +341,9 @@ Judgement Bgp_RebuildMsgFromRib(const Prefix *nlri,
goto error; // error already set
// Rebuild attribute on the fly with original AFI and SAFI
Bgpattr *mpUnreach = (Bgpattr *) alloca(3 + 2 + 1);
attrSiz = 3 + 2 + 1;
Bgpattr *mpUnreach = (Bgpattr *) alloca(attrSiz);
mpUnreach->flags = flags;
mpUnreach->code = BGP_ATTR_MP_UNREACH_NLRI;
mpUnreach->len = 3;