diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-01-07 18:35:03 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-01-07 18:35:03 +0100 |
commit | 7d767c5a3d001a6a1a5c3e800553202fd492190c (patch) | |
tree | 6a0758ae4bdd2b4cbecefec9ed329b43d038a270 /sysdep/unix/krt.h | |
parent | ef8c45749c82e246d477ea4d7f749668a9c7e9ee (diff) |
KRT: Improve syncer code to avoid using temporary data in rtable
The old code stored route verdicts and temporary routes directly in
rtable. The new code do not store received routes (it immediately
compares them with exported routes and resolves conflicts) and uses
internal bitmap to keep track of which routes were received and which
needs to be reinstalled.
By not putting 'invalid' temporary routes to rtable, we keep rtable
in consistent state, therefore scan no longer needs to be atomic
operation and could be splitted to multiple events.
Diffstat (limited to 'sysdep/unix/krt.h')
-rw-r--r-- | sysdep/unix/krt.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h index c5b565f5..6066f2f1 100644 --- a/sysdep/unix/krt.h +++ b/sysdep/unix/krt.h @@ -19,15 +19,6 @@ struct kif_proto; #include "sysdep/config.h" #include CONFIG_INCLUDE_KRTSYS_H -/* Flags stored in net->n.flags, rest are in nest/route.h */ - -#define KRF_VERDICT_MASK 0x0f -#define KRF_CREATE 0 /* Not seen in kernel table */ -#define KRF_SEEN 1 /* Seen in kernel table during last scan */ -#define KRF_UPDATE 2 /* Need to update this entry */ -#define KRF_DELETE 3 /* Should be deleted */ -#define KRF_IGNORE 4 /* To be ignored */ - #define KRT_DEFAULT_ECMP_LIMIT 16 #define EA_KRT_SOURCE EA_CODE(PROTOCOL_KERNEL, 0) @@ -66,6 +57,7 @@ struct krt_proto { #endif struct bmap sync_map; /* Keeps track which exported routes were successfully written to kernel */ + struct bmap seen_map; /* Routes seen during last periodic scan */ node krt_node; /* Node in krt_proto_list */ byte af; /* Kernel address family (AF_*) */ byte ready; /* Initial feed has been finished */ |