mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
BGP: Attribute set function merged with its common counterpart
This commit is contained in:
parent
d8e816c150
commit
daf113ac66
@ -84,24 +84,14 @@ bgp_set_attr(ea_list **attrs, struct linpool *pool, uint code, uint flags, uintp
|
|||||||
{
|
{
|
||||||
ASSERT(bgp_attr_known(code));
|
ASSERT(bgp_attr_known(code));
|
||||||
|
|
||||||
ea_list *a = lp_alloc(pool, sizeof(ea_list) + sizeof(eattr));
|
return ea_set_attr(
|
||||||
eattr *e = &a->attrs[0];
|
attrs,
|
||||||
|
pool,
|
||||||
a->flags = EALF_SORTED;
|
EA_CODE(PROTOCOL_BGP, code),
|
||||||
a->count = 1;
|
flags,
|
||||||
a->next = *attrs;
|
bgp_attr_table[code].type,
|
||||||
*attrs = a;
|
val
|
||||||
|
);
|
||||||
e->id = EA_CODE(PROTOCOL_BGP, code);
|
|
||||||
e->type = bgp_attr_table[code].type;
|
|
||||||
e->flags = flags;
|
|
||||||
|
|
||||||
if (e->type & EAF_EMBEDDED)
|
|
||||||
e->u.data = (u32) val;
|
|
||||||
else
|
|
||||||
e->u.ptr = (struct adata *) val;
|
|
||||||
|
|
||||||
return e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user