mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
OSPF: Improved handling of tmpattrs
Keep track of whether OSPF tmpattrs are actually defined for given route (using flags in rte->pflags). That makes them behave more like real eattrs so a protocol can define just a subset of them or they can be undefined by filters. Do not set ospf_metric2 for other than type 2 external OSPF routes and do not set ospf_tag for non-external OSPF routes. That also fixes a bug where internal/inter-area route propagated from one OSPF instance to another is initiated with infinity ospf_metric2. Thanks to Yaroslav Dronskii for the bugreport.
This commit is contained in:
@@ -308,6 +308,8 @@ void rte_free(rte *);
|
||||
rte *rte_do_cow(rte *);
|
||||
static inline rte * rte_cow(rte *r) { return (r->flags & REF_COW) ? rte_do_cow(r) : r; }
|
||||
rte *rte_cow_rta(rte *r, linpool *lp);
|
||||
void rte_make_tmp_attr(struct rte *r, struct ea_list *e, uint id, uint type, u32 val);
|
||||
uint rte_store_tmp_attr(struct rte *r, uint id);
|
||||
void rt_dump(rtable *);
|
||||
void rt_dump_all(void);
|
||||
int rt_feed_channel(struct channel *c);
|
||||
@@ -481,6 +483,7 @@ typedef struct eattr {
|
||||
#define EA_CODE(proto,id) (((proto) << 8) | (id))
|
||||
#define EA_ID(ea) ((ea) & 0xff)
|
||||
#define EA_PROTO(ea) ((ea) >> 8)
|
||||
#define EA_ID_FLAG(ea) (1 << EA_ID(ea))
|
||||
#define EA_CUSTOM(id) ((id) | EA_CUSTOM_BIT)
|
||||
#define EA_IS_CUSTOM(ea) ((ea) & EA_CUSTOM_BIT)
|
||||
#define EA_CUSTOM_ID(ea) ((ea) & ~EA_CUSTOM_BIT)
|
||||
|
Reference in New Issue
Block a user