struct bgp_path_info *tmp_pi;
struct bgp_path_info *local_pi;
struct attr *attr_new;
+ struct attr local_attr;
mpls_label_t label[BGP_MAX_LABELS];
uint32_t num_labels = 1;
int route_change = 1;
add_mac_mobility_to_attr(seq, attr);
if (!local_pi) {
- /* Add (or update) attribute to hash. */
- attr_new = bgp_attr_intern(attr);
+ local_attr = *attr;
/* Extract MAC mobility sequence number, if any. */
- attr_new->mm_seqnum =
- bgp_attr_mac_mobility_seqnum(attr_new, &sticky);
- attr_new->sticky = sticky;
+ local_attr.mm_seqnum =
+ bgp_attr_mac_mobility_seqnum(&local_attr, &sticky);
+ local_attr.sticky = sticky;
+
+ /* Add (or update) attribute to hash. */
+ attr_new = bgp_attr_intern(&local_attr);
/* Create new route with its attribute. */
tmp_pi = info_make(ZEBRA_ROUTE_BGP, BGP_ROUTE_STATIC, 0,
/* The attribute has changed. */
/* Add (or update) attribute to hash. */
- attr_new = bgp_attr_intern(attr);
+ local_attr = *attr;
bgp_path_info_set_flag(dest, tmp_pi,
BGP_PATH_ATTR_CHANGED);
/* Extract MAC mobility sequence number, if any. */
- attr_new->mm_seqnum =
- bgp_attr_mac_mobility_seqnum(attr_new, &sticky);
- attr_new->sticky = sticky;
+ local_attr.mm_seqnum = bgp_attr_mac_mobility_seqnum(
+ &local_attr, &sticky);
+ local_attr.sticky = sticky;
+
+ attr_new = bgp_attr_intern(&local_attr);
/* Restore route, if needed. */
if (CHECK_FLAG(tmp_pi->flags, BGP_PATH_REMOVED))