[bgp/attribute] Make sure EXTENDED attribute bit is off when clearing MP_UNREACH_NLRI during RIB rebuild

This commit is contained in:
Lorenzo Cogotti 2021-06-08 11:08:36 +02:00
parent dd57ccac53
commit 3ab2e69bb2
1 changed files with 1 additions and 2 deletions

View File

@ -335,7 +335,6 @@ Judgement Bgp_RebuildMsgFromRib(const Prefix *nlri,
}
if (flags & BGPF_CLEARUNREACH) {
// Keep the attribute, but clear its contents
Uint8 flags = attr->flags;
const Bgpmpfam *srcFam = Bgp_GetMpFamily(attr);
if (!srcFam)
goto error; // error already set
@ -344,7 +343,7 @@ Judgement Bgp_RebuildMsgFromRib(const Prefix *nlri,
attrSiz = 3 + 2 + 1;
Bgpattr *mpUnreach = (Bgpattr *) alloca(attrSiz);
mpUnreach->flags = flags;
mpUnreach->flags = attr->flags & ~BGP_ATTR_EXTENDED;
mpUnreach->code = BGP_ATTR_MP_UNREACH_NLRI;
mpUnreach->len = 3;