summaryrefslogtreecommitdiffstats
path: root/sysdep/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/linux')
-rw-r--r--sysdep/linux/Modules1
-rw-r--r--sysdep/linux/krt-scan.Y33
-rw-r--r--sysdep/linux/krt-scan.c13
-rw-r--r--sysdep/linux/krt-scan.h1
4 files changed, 42 insertions, 6 deletions
diff --git a/sysdep/linux/Modules b/sysdep/linux/Modules
index 5562ab2..6244479 100644
--- a/sysdep/linux/Modules
+++ b/sysdep/linux/Modules
@@ -1,2 +1,3 @@
krt-scan.c
krt-scan.h
+krt-scan.Y
diff --git a/sysdep/linux/krt-scan.Y b/sysdep/linux/krt-scan.Y
new file mode 100644
index 0000000..fcdcfe6
--- /dev/null
+++ b/sysdep/linux/krt-scan.Y
@@ -0,0 +1,33 @@
+/*
+ * BIRD -- Linux Kernel Syncer Configuration
+ *
+ * (c) 1998 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+CF_HDR
+
+#include "lib/krt-scan.h"
+
+CF_DECLS
+
+CF_KEYWORDS(LEARN, SCAN, TIME)
+
+CF_GRAMMAR
+
+CF_ADDTO(kern_proto, kern_proto krt_scan_item ';')
+
+krt_scan_item:
+ LEARN bool {
+ ((struct krt_proto *) this_proto)->scanopt.learn = $2;
+ }
+ | SCAN TIME expr {
+ /* Scan time of 0 means scan on startup only */
+ ((struct krt_proto *) this_proto)->scanopt.recurrence = $3;
+ }
+ ;
+
+CF_CODE
+
+CF_END
diff --git a/sysdep/linux/krt-scan.c b/sysdep/linux/krt-scan.c
index 6fdb3bf..9d8cf5f 100644
--- a/sysdep/linux/krt-scan.c
+++ b/sysdep/linux/krt-scan.c
@@ -131,11 +131,11 @@ krt_parse_entry(byte *e, struct krt_proto *p)
return;
#endif
DBG("krt_parse_entry: kernel reporting unknown route %I/%d\n", dest, masklen);
-#if 1
- /* FIXME: should be configurable */
- if (flags & RTF_GATEWAY)
- krt_magic_route(p, net, gw);
-#endif
+ if (p->scanopt.learn)
+ {
+ if (flags & RTF_GATEWAY)
+ krt_magic_route(p, net, gw);
+ }
net->n.flags |= KRF_UPDATE;
}
}
@@ -235,7 +235,8 @@ krt_scan_preconfig(struct krt_proto *x)
{
SCANOPT;
- p->recurrence = 10; /* FIXME: use reasonable default value */
+ p->recurrence = 60;
+ p->learn = 0;
}
void
diff --git a/sysdep/linux/krt-scan.h b/sysdep/linux/krt-scan.h
index 1ea1ca7..18073e2 100644
--- a/sysdep/linux/krt-scan.h
+++ b/sysdep/linux/krt-scan.h
@@ -11,6 +11,7 @@
struct krt_scan_params {
int recurrence; /* How often should we scan krt, 0=only on startup */
+ int learn; /* Should we learn routes from the kernel? */
struct timer *timer;
};