summaryrefslogtreecommitdiff
path: root/sysdep/linux
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-12-06 17:40:42 +0000
committerMartin Mares <mj@ucw.cz>1998-12-06 17:40:42 +0000
commit980ffedbb04bf3beedf147fc7dfed40cdbf968aa (patch)
tree075cadebb6c03fe359f77f51dc11d5e06d66f95f /sysdep/linux
parent0846203e896d8ab009217968e391b5e13ea3c4c6 (diff)
Kernel syncer is now configurable. It will probably need some more
options, but at least basic tuning is possible now.
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 5562ab21..6244479f 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 00000000..fcdcfe66
--- /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 6fdb3bfd..9d8cf5f4 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 1ea1ca72..18073e2b 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;
};