diff options
-rw-r--r-- | bgpd/bgp_attr.c | 12 | ||||
-rw-r--r-- | bgpd/bgp_attr.h | 43 | ||||
-rw-r--r-- | bgpd/bgp_memory.c | 1 | ||||
-rw-r--r-- | bgpd/bgp_memory.h | 1 |
4 files changed, 10 insertions, 47 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 008998c8b..4f25f2284 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -95,16 +95,6 @@ static const struct message attr_flag_str[] = { static struct hash *cluster_hash; -struct attr_extra *bgp_attr_extra_alloc(void) -{ - return XCALLOC(MTYPE_ATTR_EXTRA, sizeof(struct attr_extra)); -} - -void bgp_attr_extra_free(struct attr *attr) -{ - XFREE(MTYPE_ATTR_EXTRA, attr->extra); -} - static void *cluster_hash_alloc(void *p) { const struct cluster_list *val = (const struct cluster_list *)p; @@ -789,7 +779,6 @@ static void attrhash_init(void) */ static void attr_vfree(void *attr) { - bgp_attr_extra_free(attr); XFREE(MTYPE_ATTR, attr); } @@ -1236,7 +1225,6 @@ void bgp_attr_flush(struct attr *attr) bgp_attr_set_vnc_subtlvs(attr, NULL); } #endif - bgp_attr_extra_free(attr); } /* Implement draft-scudder-idr-optional-transitive behaviour and diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 9e9470426..16eb956b3 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -159,14 +159,6 @@ struct bgp_attr_srv6_l3vpn { uint8_t transposition_offset; }; -struct attr_extra { - /* PMSI tunnel type (RFC 6514). */ - enum pta_type pmsi_tnl_type; - - /* Extended Communities attribute. */ - struct ecommunity *ipv6_ecommunity; -}; - /* BGP core attribute structure. */ struct attr { /* AS Path structure */ @@ -190,6 +182,9 @@ struct attr { /* Path origin attribute */ uint8_t origin; + /* PMSI tunnel type (RFC 6514). */ + enum pta_type pmsi_tnl_type; + /* has the route-map changed any attribute? Used on the peer outbound side. */ uint32_t rmap_change_flags; @@ -204,8 +199,8 @@ struct attr { /* Extended Communities attribute. */ struct ecommunity *ecommunity; - /* Extra attributes, non IPv4/IPv6 AFI related */ - struct attr_extra *extra; + /* Extended Communities attribute. */ + struct ecommunity *ipv6_ecommunity; /* Large Communities attribute. */ struct lcommunity *lcommunity; @@ -478,8 +473,6 @@ extern void bgp_packet_mpunreach_end(struct stream *s, size_t attrlen_pnt); extern bgp_attr_parse_ret_t bgp_attr_nexthop_valid(struct peer *peer, struct attr *attr); -extern struct attr_extra *bgp_attr_extra_alloc(void); -extern void bgp_attr_extra_free(struct attr *attr); static inline int bgp_rmap_nhop_changed(uint32_t out_rmap_flags, uint32_t in_rmap_flags) @@ -502,21 +495,15 @@ static inline uint32_t mac_mobility_seqnum(struct attr *attr) return (attr) ? attr->mm_seqnum : 0; } -static inline enum pta_type bgp_attr_get_pmsi_tnl_type(const struct attr *attr) +static inline enum pta_type bgp_attr_get_pmsi_tnl_type(struct attr *attr) { - if (attr->extra) - return attr->extra->pmsi_tnl_type; - - return PMSI_TNLTYPE_NO_INFO; + return attr->pmsi_tnl_type; } static inline void bgp_attr_set_pmsi_tnl_type(struct attr *attr, enum pta_type pmsi_tnl_type) { - if (!attr->extra) - attr->extra = bgp_attr_extra_alloc(); - - attr->extra->pmsi_tnl_type = pmsi_tnl_type; + attr->pmsi_tnl_type = pmsi_tnl_type; } static inline struct ecommunity * @@ -546,23 +533,13 @@ static inline void bgp_attr_set_lcommunity(struct attr *attr, static inline struct ecommunity * bgp_attr_get_ipv6_ecommunity(const struct attr *attr) { - if (attr->extra) - return attr->extra->ipv6_ecommunity; - - return NULL; + return attr->ipv6_ecommunity; } static inline void bgp_attr_set_ipv6_ecommunity(struct attr *attr, struct ecommunity *ipv6_ecomm) { - if (!attr->extra) { - if (!ipv6_ecomm) - return; - - attr->extra = bgp_attr_extra_alloc(); - } - - attr->extra->ipv6_ecommunity = ipv6_ecomm; + attr->ipv6_ecommunity = ipv6_ecomm; } static inline struct transit *bgp_attr_get_transit(const struct attr *attr) diff --git a/bgpd/bgp_memory.c b/bgpd/bgp_memory.c index 7fbadab69..ffb1ec162 100644 --- a/bgpd/bgp_memory.c +++ b/bgpd/bgp_memory.c @@ -43,7 +43,6 @@ DEFINE_MTYPE(BGPD, BGP_UPDGRP, "BGP update group"); DEFINE_MTYPE(BGPD, BGP_UPD_SUBGRP, "BGP update subgroup"); DEFINE_MTYPE(BGPD, BGP_PACKET, "BGP packet"); DEFINE_MTYPE(BGPD, ATTR, "BGP attribute"); -DEFINE_MTYPE(BGPD, ATTR_EXTRA, "BGP extra attribute"); DEFINE_MTYPE(BGPD, AS_PATH, "BGP aspath"); DEFINE_MTYPE(BGPD, AS_SEG, "BGP aspath seg"); DEFINE_MTYPE(BGPD, AS_SEG_DATA, "BGP aspath segment data"); diff --git a/bgpd/bgp_memory.h b/bgpd/bgp_memory.h index ffab8a1bc..63e7b40ef 100644 --- a/bgpd/bgp_memory.h +++ b/bgpd/bgp_memory.h @@ -39,7 +39,6 @@ DECLARE_MTYPE(BGP_UPDGRP); DECLARE_MTYPE(BGP_UPD_SUBGRP); DECLARE_MTYPE(BGP_PACKET); DECLARE_MTYPE(ATTR); -DECLARE_MTYPE(ATTR_EXTRA); DECLARE_MTYPE(AS_PATH); DECLARE_MTYPE(AS_SEG); DECLARE_MTYPE(AS_SEG_DATA); |