diff options
Diffstat (limited to 'isisd/isis_circuit.c')
-rw-r--r-- | isisd/isis_circuit.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 4c095c26d..20094fb62 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -615,37 +615,31 @@ int isis_circuit_up(struct isis_circuit *circuit) /* 8.4.1 a) commence sending of IIH PDUs */ - if (circuit->is_type & IS_LEVEL_1) { - thread_add_event(master, send_lan_l1_hello, circuit, 0, - NULL); - circuit->u.bc.lan_neighs[0] = list_new(); - } + for (int level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) { + if (!(circuit->is_type & level)) + continue; - if (circuit->is_type & IS_LEVEL_2) { - thread_add_event(master, send_lan_l2_hello, circuit, 0, - NULL); - circuit->u.bc.lan_neighs[1] = list_new(); + thread_add_event(master, send_hello_cb, + &circuit->level_arg[level - 1], 0, + &circuit->u.bc.t_send_lan_hello[level - 1]); + circuit->u.bc.lan_neighs[level - 1] = list_new(); + + thread_add_timer(master, isis_run_dr, + &circuit->level_arg[level - 1], + 2 * circuit->hello_interval[level - 1], + &circuit->u.bc.t_run_dr[level - 1]); } /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */ /* 8.4.1 c) FIXME: listen for ESH PDUs */ - - /* 8.4.1 d) */ - /* dr election will commence in... */ - if (circuit->is_type & IS_LEVEL_1) - thread_add_timer(master, isis_run_dr_l1, circuit, - 2 * circuit->hello_interval[0], - &circuit->u.bc.t_run_dr[0]); - if (circuit->is_type & IS_LEVEL_2) - thread_add_timer(master, isis_run_dr_l2, circuit, - 2 * circuit->hello_interval[1], - &circuit->u.bc.t_run_dr[1]); } else if (circuit->circ_type == CIRCUIT_T_P2P) { /* initializing the hello send threads * for a ptp IF */ circuit->u.p2p.neighbor = NULL; - thread_add_event(master, send_p2p_hello, circuit, 0, NULL); + thread_add_event(master, send_hello_cb, + &circuit->level_arg[0], 0, + &circuit->u.p2p.t_send_p2p_hello); } /* initializing PSNP timers */ |