summaryrefslogtreecommitdiff
path: root/lib/route.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 16:48:17 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 16:48:17 +0200
commitb7e2edd4419fecb09b8690f8731e172f0c24789c (patch)
tree41c80ab4b0d524ff34e207bf15e8d79191276a2c /lib/route.h
parentd7bec897ab772cdccce10b296d4efd48d9181297 (diff)
parent1d309c4ce6e95b68c64a8f007f6dd2f1830a5707 (diff)
Merge commit '1d309c4ce6e95b68c64a8f007f6dd2f1830a5707' into haugesund
Diffstat (limited to 'lib/route.h')
-rw-r--r--lib/route.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/route.h b/lib/route.h
index 183626e9..48595091 100644
--- a/lib/route.h
+++ b/lib/route.h
@@ -146,6 +146,8 @@ typedef struct eattr {
byte fresh:1; /* An uncached attribute (e.g. modified in export filter) */
byte undef:1; /* Explicitly undefined */
+ PADDING(unused, 0, 4);
+
union bval u;
} eattr;
@@ -227,9 +229,14 @@ struct ea_one_attr_list {
EA_LITERAL_GENERIC(_id, _type, _flags, .u.i = _val); \
})
-#define EA_LITERAL_ADATA(_id, _type, _flags, _buf, _len) ({ \
+#define EA_LITERAL_STORE_ADATA(_id, _type, _flags, _buf, _len) ({ \
+ ASSERT_DIE(!(_type & EAF_EMBEDDED)); \
+ EA_LITERAL_GENERIC(_id, _type, _flags, .u.ad = tmp_store_adata((_buf), (_len))); \
+ })
+
+#define EA_LITERAL_DIRECT_ADATA(_id, _type, _flags, _adata) ({ \
ASSERT_DIE(!(_type & EAF_EMBEDDED)); \
- EA_LITERAL_GENERIC(_id, _type, _flags, .u.ad = tmp_store_adata(_buf, _len)); \
+ EA_LITERAL_GENERIC(_id, _type, _flags, .u.ad = _adata); \
})
#define EA_LITERAL_GENERIC(_id, _type, _flags, ...) \
@@ -263,7 +270,7 @@ ea_set_attr_u32(ea_list **to, uint id, uint flags, uint type, u32 data)
static inline void
ea_set_attr_data(ea_list **to, uint id, uint flags, uint type, void *data, uint len)
-{ ea_set_attr(to, EA_LITERAL_ADATA(id, type, flags, data, len)); }
+{ ea_set_attr(to, EA_LITERAL_STORE_ADATA(id, type, flags, data, len)); }
#define NEXTHOP_MAX_SIZE (sizeof(struct nexthop) + sizeof(u32)*MPLS_MAX_LABEL_STACK)