return pi->extra;
}
-/* Allocate new bgp info structure. */
-struct bgp_path_info *bgp_path_info_new(void)
-{
- return XCALLOC(MTYPE_BGP_ROUTE, sizeof(struct bgp_path_info));
-}
-
/* Free bgp route information. */
static void bgp_path_info_free(struct bgp_path_info *path)
{
extern struct bgp_node *bgp_afi_node_lookup(struct bgp_table *table, afi_t afi,
safi_t safi, struct prefix *p,
struct prefix_rd *prd);
-extern struct bgp_path_info *bgp_path_info_new(void);
extern void bgp_path_info_restore(struct bgp_node *rn,
struct bgp_path_info *path);
}
}
-
- new = bgp_path_info_new();
- new->type = type;
- new->sub_type = sub_type;
- new->peer = rfd->peer;
+ new = info_make(type, sub_type, 0, rfd->peer, new_attr, NULL);
SET_FLAG(new->flags, BGP_PATH_VALID);
- new->attr = new_attr;
- new->uptime = bgp_clock();
/* save backref to rfapi handle */
assert(bgp_path_info_extra_get(new));
{
struct bgp_path_info *new;
- new = bgp_path_info_new();
- assert(new);
+ new = info_make(type, sub_type, 0, peer, attr, NULL);
+
+ if (attr)
+ new->attr = bgp_attr_intern(attr);
- if (attr) {
- if (!new->attr)
- new->attr = bgp_attr_intern(attr);
- }
bgp_path_info_extra_get(new);
if (prd) {
new->extra->vnc.import.rd = *prd;
}
if (label)
encode_label(*label, &new->extra->label[0]);
- new->type = type;
- new->sub_type = sub_type;
- new->peer = peer;
+
peer_lock(peer);
return new;