summaryrefslogtreecommitdiff
path: root/sysdep/unix/krt.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-12-19 16:34:35 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-12-19 16:34:35 +0100
commitcc75b3e1dc4a7440479d6f4d73e7e1b9ba65332f (patch)
tree9401f2da909192332ee64ea344e762e055c5f4de /sysdep/unix/krt.h
parent90a9c97e38e3769b400b434723516213eccb3ab0 (diff)
KRT: Remove KRF_SYNC_ERROR flag
This info is now stored in an internal bmap. Unfortunately, net.flags is still needed for temporary kernel data.
Diffstat (limited to 'sysdep/unix/krt.h')
-rw-r--r--sysdep/unix/krt.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
index 6ace2a86..c5b565f5 100644
--- a/sysdep/unix/krt.h
+++ b/sysdep/unix/krt.h
@@ -65,6 +65,7 @@ struct krt_proto {
timer *scan_timer;
#endif
+ struct bmap sync_map; /* Keeps track which exported routes were successfully written to kernel */
node krt_node; /* Node in krt_proto_list */
byte af; /* Kernel address family (AF_*) */
byte ready; /* Initial feed has been finished */
@@ -86,6 +87,14 @@ void kif_request_scan(void);
void krt_got_route(struct krt_proto *p, struct rte *e);
void krt_got_route_async(struct krt_proto *p, struct rte *e, int new);
+static inline int
+krt_get_sync_error(struct krt_proto *p, struct rte *e)
+{
+ return (p->p.proto_state == PS_UP) &&
+ bmap_test(&p->p.main_channel->export_map, e->id) &&
+ !bmap_test(&p->sync_map, e->id);
+}
+
/* Values for rte->u.krt_sync.src */
#define KRT_SRC_UNKNOWN -1 /* Nobody knows */
#define KRT_SRC_BIRD 0 /* Our route (not passed in async mode) */