summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-09-07 13:54:20 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-08 15:24:02 +0200
commitfb7fb6744582b2bb74b3b1e32696bd5534e93054 (patch)
treea5b6d0bf41556edc242bd5dbf8d0aaf96af66ae1 /lib
parenta42877b9bf09c4c042bced3910ade9b71ce3724c (diff)
Table access is now locked.
Diffstat (limited to 'lib')
-rw-r--r--lib/birdlib.h3
-rw-r--r--lib/route.h4
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/birdlib.h b/lib/birdlib.h
index d55b1a44..d743ecdf 100644
--- a/lib/birdlib.h
+++ b/lib/birdlib.h
@@ -14,8 +14,9 @@
/* Ugly structure offset handling macros */
+#define SAME_TYPE(a, b) ({ int _ = ((a) != (b)); !_; })
#define OFFSETOF(s, i) ((size_t) &((s *)0)->i)
-#define SKIP_BACK(s, i, p) ({ s *_ptr = ((s *)((char *)p - OFFSETOF(s, i))); ASSERT_DIE(&_ptr->i == p); _ptr; })
+#define SKIP_BACK(s, i, p) ({ s *_ptr = ((s *)((char *)p - OFFSETOF(s, i))); SAME_TYPE(&_ptr->i, p); _ptr; })
#define BIRD_ALIGN(s, a) (((s)+a-1)&~(a-1))
#define CPU_STRUCT_ALIGN (MAX_(_Alignof(void*), _Alignof(u64)))
#define BIRD_CPU_ALIGN(s) BIRD_ALIGN((s), CPU_STRUCT_ALIGN)
diff --git a/lib/route.h b/lib/route.h
index f5456396..eae251e7 100644
--- a/lib/route.h
+++ b/lib/route.h
@@ -20,7 +20,7 @@
struct network;
struct proto;
struct cli;
-struct rtable;
+struct rtable_private;
typedef struct rte {
struct ea_list *attrs; /* Attributes of this route */
@@ -63,7 +63,7 @@ struct rte_owner_class {
struct rte_owner {
struct rte_owner_class *class;
- int (*rte_recalculate)(struct rtable *, struct network *, struct rte *, struct rte *, struct rte *);
+ int (*rte_recalculate)(struct rtable_private *, struct network *, struct rte *, struct rte *, struct rte *);
HASH(struct rte_src) hash;
const char *name;
u32 hash_key;