summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2015-11-03 14:42:41 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2015-11-11 11:40:49 +0100
commit9ddbfbddf87462bbf50437bdc1d44499a5c223e7 (patch)
tree31d59d5053d60bc2d43ef3c82969b4d789c58fe7 /sysdep/unix
parent86b4e17001fe4cca6dde7ff523346121c0ae68fe (diff)
Netlink: Allow more than 256 routing tables.
Since 2.6.19, the netlink API defines RTA_TABLE routing attribute to allow 32-bit routing table IDs. Using this attribute to index routing tables at Linux, instead of 8-bit rtm_table field.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/krt.c11
-rw-r--r--sysdep/unix/krt.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index 2eab5cb2..49bf9519 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -77,6 +77,7 @@ krt_io_init(void)
krt_pool = rp_new(&root_pool, "Kernel Syncer");
krt_filter_lp = lp_new(krt_pool, 4080);
init_list(&krt_proto_list);
+ krt_sys_io_init();
}
/*
@@ -1126,7 +1127,11 @@ krt_start(struct proto *P)
krt_learn_init(p);
#endif
- krt_sys_start(p);
+ if (!krt_sys_start(p))
+ {
+ rem_node(&p->krt_node);
+ return PS_START;
+ }
krt_scan_timer_start(p);
@@ -1150,8 +1155,10 @@ krt_shutdown(struct proto *P)
p->ready = 0;
p->initialized = 0;
- krt_sys_shutdown(p);
+ if (p->p.proto_state == PS_START)
+ return PS_DOWN;
+ krt_sys_shutdown(p);
rem_node(&p->krt_node);
return PS_DOWN;
diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
index 9d5d4e8c..aea20102 100644
--- a/sysdep/unix/krt.h
+++ b/sysdep/unix/krt.h
@@ -119,8 +119,9 @@ struct proto_config * krt_init_config(int class);
/* krt sysdep */
+void krt_sys_io_init(void);
void krt_sys_init(struct krt_proto *);
-void krt_sys_start(struct krt_proto *);
+int krt_sys_start(struct krt_proto *);
void krt_sys_shutdown(struct krt_proto *);
int krt_sys_reconfigure(struct krt_proto *p UNUSED, struct krt_config *n, struct krt_config *o);