mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
Filter: Initialize route attribute flags properly
Move 'flags' field back to ea_class, so filtering code can use it to initialize route attribute flags when set by filters.
This commit is contained in:
parent
0bcc7a9316
commit
07757b8a0c
@ -918,17 +918,17 @@
|
||||
|
||||
case T_IP:
|
||||
a = ea_set_attr(&fs->rte->attrs,
|
||||
EA_LITERAL_STORE_ADATA(da, 0, &v1.val.ip, sizeof(ip_addr)));
|
||||
EA_LITERAL_STORE_ADATA(da, da->flags, &v1.val.ip, sizeof(ip_addr)));
|
||||
break;
|
||||
|
||||
case T_STRING:
|
||||
a = ea_set_attr(&fs->rte->attrs,
|
||||
EA_LITERAL_STORE_ADATA(da, 0, v1.val.s, strlen(v1.val.s) + 1));
|
||||
EA_LITERAL_STORE_ADATA(da, da->flags, v1.val.s, strlen(v1.val.s) + 1));
|
||||
break;
|
||||
|
||||
default:
|
||||
a = ea_set_attr(&fs->rte->attrs,
|
||||
EA_LITERAL_GENERIC(da->id, da->type, 0, .u = v1.val.bval));
|
||||
EA_LITERAL_GENERIC(da->id, da->type, da->flags, .u = v1.val.bval));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -259,6 +259,7 @@ struct ea_class {
|
||||
uint id; /* Autoassigned attribute ID */ \
|
||||
uint uc; /* Reference count */ \
|
||||
btype type; /* Data type ID */ \
|
||||
u16 flags; /* Protocol-dependent flags */ \
|
||||
uint readonly:1; /* This attribute can't be changed by filters */ \
|
||||
uint conf:1; /* Requested by config */ \
|
||||
uint hidden:1; /* Technical attribute, do not show, do not expose to filters */ \
|
||||
|
@ -70,7 +70,6 @@ union bgp_attr_desc {
|
||||
struct ea_class class;
|
||||
struct {
|
||||
EA_CLASS_INSIDE;
|
||||
uint flags;
|
||||
void (*export)(struct bgp_export_state *s, eattr *a);
|
||||
int (*encode)(struct bgp_write_state *s, eattr *a, byte *buf, uint size);
|
||||
void (*decode)(struct bgp_parse_state *s, uint code, uint flags, byte *data, uint len, ea_list **to);
|
||||
|
Loading…
Reference in New Issue
Block a user