void
krt_do_scan(struct krt_proto *p)
{
- krt_sysctl_scan((struct proto *)p, p->krt_pool, &krt_buffer, &krt_buflen,
- krt_sysctl_scan(&p->p, p->p.pool, &krt_buffer, &krt_buflen, NET_RT_DUMP);
++<<<<<<< HEAD:sysdep/bsd/krt-sock.c
++ krt_sysctl_scan(&p->p, p->krt_pool, &krt_buffer, &krt_buflen,
+ NET_RT_DUMP, rt_to_af(p->addr_type));
}
void
kif_do_scan(struct kif_proto *p)
{
- struct proto *P = (struct proto *)p;
if_start_update();
- krt_sysctl_scan(P, P->pool, &kif_buffer, &kif_buflen, NET_RT_IFLIST, 0);
- krt_sysctl_scan(&p->p, p->p.pool, &kif_buffer, &kif_buflen, NET_RT_IFLIST);
++ krt_sysctl_scan(&p->p, p->p.pool, &kif_buffer, &kif_buflen, NET_RT_IFLIST, 0);
if_end_update();
}
* Interface to the UNIX krt module
*/
-static u8 nl_cf_table[(NL_NUM_TABLES+7) / 8];
-
void
- krt_sys_start(struct krt_proto *p, int first)
+ krt_sys_start(struct krt_proto *p)
{
- nl_table_map[KRT_CF->sys.table_id] = p;
+ nl_tablex_map(p->addr_type == RT_IPV4)[KRT_CF->sys.table_id] = p;
- if (first)
- {
- nl_open();
- nl_open_async();
- }
+
+ nl_open();
+ nl_open_async();
}
void
krt_start(struct proto *P)
{
struct krt_proto *p = (struct krt_proto *) P;
- int first = 1;
- #ifdef CONFIG_ALL_TABLES_AT_ONCE
- if (!krt_instance_count++)
- init_list(&krt_instance_list);
- else
- first = 0;
- p->krt_pool = krt_pool;
- add_tail(&krt_instance_list, &p->instance_node);
- #else
- p->krt_pool = P->pool;
- #endif
+ add_tail(&krt_proto_list, &p->krt_node);
+ p->addr_type = p->p.table->addr_type;
+
#ifdef KRT_ALLOW_LEARN
krt_learn_init(p);
#endif
#ifdef KRT_ALLOW_LEARN
struct rtable krt_table; /* Internal table of inherited routes */
#endif
- pool *krt_pool; /* Pool used for common krt data */
+
+ #ifndef CONFIG_ALL_TABLES_AT_ONCE
timer *scan_timer;
- #ifdef CONFIG_ALL_TABLES_AT_ONCE
- node instance_node; /* Node in krt instance list */
#endif
+
+ node krt_node; /* Node in krt_proto_list */
+ int addr_type; /* Kernel table address type */
int initialized; /* First scan has already been finished */
};