diff options
Diffstat (limited to 'sysdep/unix/krt.c')
-rw-r--r-- | sysdep/unix/krt.c | 13 |
1 files changed, 10 insertions, 3 deletions
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) { |