@@ -1108,7 +1108,7 @@ unsigned int attrhash_key_make(const void *p)
11081108 key = jhash (attr -> mp_nexthop_global .s6_addr , IPV6_MAX_BYTELEN , key );
11091109 key = jhash (attr -> mp_nexthop_local .s6_addr , IPV6_MAX_BYTELEN , key );
11101110 MIX3 (attr -> nh_ifindex , attr -> nh_lla_ifindex , attr -> distance );
1111- MIX3 (attr -> bh_type , attr -> otc , bgp_attr_get_aigp_metric (attr ));
1111+ MIX3 (attr -> bh_type , bgp_attr_get_otc ( attr ) , bgp_attr_get_aigp_metric (attr ));
11121112 MIX3 (attr -> mm_seqnum , attr -> df_alg , attr -> df_pref );
11131113 MIX (attr -> encap_tunneltype );
11141114 MIX (bgp_attr_get_pmsi_tnl_type (attr ));
@@ -1167,7 +1167,8 @@ bool attrhash_cmp(const void *p1, const void *p2)
11671167 bgp_attr_get_srv6_l3service (attr2 )) &&
11681168 srv6_vpn_same (bgp_attr_get_srv6_vpn (attr1 ), bgp_attr_get_srv6_vpn (attr2 )) &&
11691169 attr1 -> srte_color == attr2 -> srte_color && attr1 -> nh_type == attr2 -> nh_type &&
1170- attr1 -> bh_type == attr2 -> bh_type && attr1 -> otc == attr2 -> otc &&
1170+ attr1 -> bh_type == attr2 -> bh_type &&
1171+ bgp_attr_get_otc (attr1 ) == bgp_attr_get_otc (attr2 ) &&
11711172 !memcmp (& attr1 -> rmac , & attr2 -> rmac , sizeof (struct ethaddr )) &&
11721173 bgp_nhc_same (bgp_attr_get_nhc (attr1 ), bgp_attr_get_nhc (attr2 )) &&
11731174 bgp_ls_attr_same (bgp_attr_get_ls_attr (attr1 ), bgp_attr_get_ls_attr (attr2 )) &&
@@ -1242,7 +1243,7 @@ static void attr_show_all_iterator(struct hash_bucket *bucket, void *args[])
12421243 lcommunity_str (attr -> lcommunity , false, false));
12431244 vty_out (vty , "\tExtended Community: %s Extended IPv6 Community: %s\n" ,
12441245 ecommunity_str (attr -> ecommunity ),
1245- ecommunity_str (attr -> ipv6_ecommunity ));
1246+ ecommunity_str (bgp_attr_get_ipv6_ecommunity ( attr ) ));
12461247
12471248 if (nhc ) {
12481249 vty_out (vty , "\tNHC: TLVs length %d\n" , nhc -> tlvs_length );
@@ -4261,14 +4262,15 @@ static enum bgp_attr_parse_ret bgp_attr_otc(struct bgp_attr_parser_args *args)
42614262 if (peer -> discard_attrs [args -> type ] || peer -> withdraw_attrs [args -> type ])
42624263 goto otc_ignore ;
42634264
4264- attr -> otc = stream_getl (connection -> curr );
4265- if (!attr -> otc ) {
4265+ uint32_t otc = stream_getl (connection -> curr );
4266+
4267+ if (!otc ) {
42664268 flog_err (EC_BGP_ATTR_MAL_AS_PATH , "OTC attribute value is 0" );
42674269 return bgp_attr_malformed (args , BGP_NOTIFY_UPDATE_MAL_AS_PATH ,
42684270 args -> total );
42694271 }
42704272
4271- bgp_attr_set (attr , BGP_ATTR_OTC );
4273+ bgp_attr_set_otc (attr , otc );
42724274
42734275 return BGP_ATTR_PARSE_PROCEED ;
42744276
@@ -5935,7 +5937,7 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer, struct strea
59355937 stream_putc (s , BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS );
59365938 stream_putc (s , BGP_ATTR_OTC );
59375939 stream_putc (s , 4 );
5938- stream_putl (s , attr -> otc );
5940+ stream_putl (s , bgp_attr_get_otc ( attr ) );
59395941 }
59405942
59415943 /* AIGP */
@@ -6217,7 +6219,7 @@ void bgp_dump_routes_attr(struct stream *s, struct bgp_path_info *bpi,
62176219 stream_putc (s , BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS );
62186220 stream_putc (s , BGP_ATTR_OTC );
62196221 stream_putc (s , 4 );
6220- stream_putl (s , attr -> otc );
6222+ stream_putl (s , bgp_attr_get_otc ( attr ) );
62216223 }
62226224
62236225 /* AIGP */
0 commit comments