diff options
Diffstat (limited to 'sysdep')
-rw-r--r-- | sysdep/config.h | 2 | ||||
-rw-r--r-- | sysdep/linux/netlink.c | 2 | ||||
-rw-r--r-- | sysdep/unix/io.c | 6 | ||||
-rw-r--r-- | sysdep/unix/krt.Y | 8 | ||||
-rw-r--r-- | sysdep/unix/krt.c | 13 | ||||
-rw-r--r-- | sysdep/unix/krt.h | 4 |
6 files changed, 26 insertions, 9 deletions
diff --git a/sysdep/config.h b/sysdep/config.h index cf5787d0..ffab1670 100644 --- a/sysdep/config.h +++ b/sysdep/config.h @@ -13,7 +13,7 @@ #ifdef GIT_LABEL #define BIRD_VERSION XSTR1(GIT_LABEL) #else -#define BIRD_VERSION "2.13.1" +#define BIRD_VERSION "2.14" #endif /* Include parameters determined by configure script */ diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index 1af78766..29446cab 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -1598,7 +1598,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) case RTPROT_KERNEL: krt_src = KRT_SRC_KERNEL; - return; + break; case RTPROT_BIRD: if (!s->scan) diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 6aedcfb6..4b3eef48 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -2226,12 +2226,12 @@ io_loop(void) for(;;) { times_update(&main_timeloop); - events = ev_run_list(&global_event_list); - events = ev_run_list_limited(&global_work_list, WORK_EVENTS_MAX) || events; + ev_run_list(&global_event_list); + ev_run_list_limited(&global_work_list, WORK_EVENTS_MAX); timers_fire(&main_timeloop); io_close_event(); - // FIXME + events = !EMPTY_LIST(global_event_list) || !EMPTY_LIST(global_work_list); poll_tout = (events ? 0 : 3000); /* Time in milliseconds */ if (t = timers_first(&main_timeloop)) { diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y index 5af6a4c8..90297d3f 100644 --- a/sysdep/unix/krt.Y +++ b/sysdep/unix/krt.Y @@ -32,6 +32,7 @@ CF_DECLS CF_KEYWORDS(KERNEL, PERSIST, SCAN, TIME, LEARN, DEVICE, ROUTES, GRACEFUL, RESTART, KRT_SOURCE, KRT_METRIC, MERGE, PATHS) CF_KEYWORDS(INTERFACE, PREFERRED) +%type <i> kern_learn %type <i> kern_mp_limit %type <cc> kern_channel @@ -49,6 +50,11 @@ kern_proto_start: proto_start KERNEL { kern_proto: kern_proto_start proto_name '{' ; kern_proto: kern_proto kern_item ';' ; +kern_learn: + bool { $$ = $1 ? KRT_LEARN_ALIEN : KRT_LEARN_NONE; } + | ALL { $$ = KRT_LEARN_ALL; } + ; + kern_mp_limit: /* empty */ { $$ = KRT_DEFAULT_ECMP_LIMIT; } | LIMIT expr { $$ = $2; if (($2 <= 0) || ($2 > 255)) cf_error("Merge paths limit must be in range 1-255"); } @@ -68,7 +74,7 @@ kern_item: /* Scan time of 0 means scan on startup only */ THIS_KRT->scan_time = $3 S_; } - | LEARN bool { + | LEARN kern_learn { THIS_KRT->learn = $2; #ifndef KRT_ALLOW_LEARN if ($2) diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index 9f95247f..3a4b24dc 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -639,12 +639,14 @@ krt_got_route(struct krt_proto *p, rte *e, s8 src) #ifdef KRT_ALLOW_LEARN switch (src) { - case KRT_SRC_KERNEL: - goto ignore; - case KRT_SRC_REDIRECT: goto delete; + case KRT_SRC_KERNEL: + if (KRT_CF->learn != KRT_LEARN_ALL) + goto ignore; + /* fallthrough */ + case KRT_SRC_ALIEN: if (KRT_CF->learn) krt_learn_scan(p, e); @@ -780,6 +782,11 @@ krt_got_route_async(struct krt_proto *p, rte *e, int new, s8 src) break; #ifdef KRT_ALLOW_LEARN + case KRT_SRC_KERNEL: + if (KRT_CF->learn != KRT_LEARN_ALL) + break; + /* fallthrough */ + case KRT_SRC_ALIEN: if (KRT_CF->learn) { diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h index 18a206e6..e25f0b12 100644 --- a/sysdep/unix/krt.h +++ b/sysdep/unix/krt.h @@ -27,6 +27,10 @@ struct kif_proto; #define KRT_REF_SEEN 0x1 /* Seen in table */ #define KRT_REF_BEST 0x2 /* Best in table */ +#define KRT_LEARN_NONE 0 /* Do not learn */ +#define KRT_LEARN_ALIEN 1 /* Learn KRT_SRC_ALIEN routes */ +#define KRT_LEARN_ALL 2 /* Learn both KRT_SRC_ALIEN and KRT_SRC_KERNEL routes */ + /* Whenever we recognize our own routes, we allow learing of foreign routes */ #ifdef CONFIG_SELF_CONSCIOUS |