From d9219ee847a179850c25d9d0f08511becc2d3102 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 8 Apr 2024 09:26:29 +0300 Subject: [PATCH] bgpd: Drop non ieee encoding parsing for ipv6 extended communities Link-bandwidth is encoded into extended community, not ipv6 extended community. Thus it's not needed here at all. Signed-off-by: Donatas Abraitis --- bgpd/bgp_attr.c | 5 +---- bgpd/bgp_ecommunity.c | 5 ++--- bgpd/bgp_ecommunity.h | 3 +-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index e2321ad296..0ccdb338e0 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2650,10 +2650,7 @@ bgp_attr_ipv6_ext_communities(struct bgp_attr_parser_args *args) if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type]) goto ipv6_ext_community_ignore; - ipv6_ecomm = ecommunity_parse_ipv6( - stream_pnt(peer->curr), length, - CHECK_FLAG(peer->flags, - PEER_FLAG_DISABLE_LINK_BW_ENCODING_IEEE)); + ipv6_ecomm = ecommunity_parse_ipv6(stream_pnt(peer->curr), length); bgp_attr_set_ipv6_ecommunity(attr, ipv6_ecomm); /* XXX: fix ecommunity_parse to use stream API */ diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index 2e45577324..3d0193f7b8 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -237,11 +237,10 @@ struct ecommunity *ecommunity_parse(uint8_t *pnt, unsigned short length, disable_ieee_floating); } -struct ecommunity *ecommunity_parse_ipv6(uint8_t *pnt, unsigned short length, - bool disable_ieee_floating) +struct ecommunity *ecommunity_parse_ipv6(uint8_t *pnt, unsigned short length) { return ecommunity_parse_internal(pnt, length, IPV6_ECOMMUNITY_SIZE, - disable_ieee_floating); + false); } /* Duplicate the Extended Communities Attribute structure. */ diff --git a/bgpd/bgp_ecommunity.h b/bgpd/bgp_ecommunity.h index 3b558ea049..d319846887 100644 --- a/bgpd/bgp_ecommunity.h +++ b/bgpd/bgp_ecommunity.h @@ -326,8 +326,7 @@ extern void ecommunity_free(struct ecommunity **); extern struct ecommunity *ecommunity_parse(uint8_t *, unsigned short, bool disable_ieee_floating); extern struct ecommunity *ecommunity_parse_ipv6(uint8_t *pnt, - unsigned short length, - bool disable_ieee_floating); + unsigned short length); extern struct ecommunity *ecommunity_dup(struct ecommunity *); extern struct ecommunity *ecommunity_merge(struct ecommunity *, struct ecommunity *); -- 2.39.5