Commit c15d8758da for frr
commit c15d8758dab50cfaa5f03772aec2dfc2872fc863
Author: Donatas Abraitis <donatas@opensourcerouting.org>
Date: Fri Sep 18 11:19:22 2026 +0300
bgpd: Ignore the last 4-bits for unknown attributes outbound
RFC 4271 defines:
The lower-order four bits of the Attribute Flags octet are
unused. They MUST be zero when sent and MUST be ignored when
received.
We ignored this on the receive side, but let's do this outbound as well.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 2d802bd94f..153902f302 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -4353,6 +4353,12 @@ bgp_attr_unknown(struct bgp_attr_parser_args *args)
in the Attribute Flags octet is set to 1 by some previous AS, it
is not set back to 0 by the current AS. */
SET_FLAG(*startp, BGP_ATTR_FLAG_PARTIAL);
+ /* RFC 4271 defines:
+ * The lower-order four bits of the Attribute Flags octet are
+ * unused. They MUST be zero when sent and MUST be ignored when
+ * received.
+ */
+ UNSET_FLAG(*startp, 0x0F);
/* Store transitive attribute to the end of attr->transit. */
transit = bgp_attr_get_transit(attr);