mirror of https://github.com/FRRouting/frr.git
Merge pull request #9092 from rgirada/rmap
ospfd: OSPF hello packets not sent with configured hello timer
This commit is contained in:
commit
761704b370
|
@ -1447,6 +1447,58 @@ static int ospf_ifp_destroy(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Resetting ospf hello timer */
|
||||
void ospf_reset_hello_timer(struct interface *ifp, struct in_addr addr,
|
||||
bool is_addr)
|
||||
{
|
||||
struct route_node *rn;
|
||||
|
||||
if (is_addr) {
|
||||
struct prefix p;
|
||||
struct ospf_interface *oi = NULL;
|
||||
|
||||
p.u.prefix4 = addr;
|
||||
p.family = AF_INET;
|
||||
|
||||
oi = ospf_if_table_lookup(ifp, &p);
|
||||
|
||||
if (oi) {
|
||||
/* Send hello before restart the hello timer
|
||||
* to avoid session flaps in case of bigger
|
||||
* hello interval configurations.
|
||||
*/
|
||||
ospf_hello_send(oi);
|
||||
|
||||
/* Restart hello timer for this interface */
|
||||
OSPF_ISM_TIMER_OFF(oi->t_hello);
|
||||
OSPF_HELLO_TIMER_ON(oi);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (rn = route_top(IF_OIFS(ifp)); rn; rn = route_next(rn)) {
|
||||
struct ospf_interface *oi = rn->info;
|
||||
|
||||
if (!oi)
|
||||
continue;
|
||||
|
||||
/* If hello interval configured on this oi, don't restart. */
|
||||
if (OSPF_IF_PARAM_CONFIGURED(oi->params, v_hello))
|
||||
continue;
|
||||
|
||||
/* Send hello before restart the hello timer
|
||||
* to avoid session flaps in case of bigger
|
||||
* hello interval configurations.
|
||||
*/
|
||||
ospf_hello_send(oi);
|
||||
|
||||
/* Restart the hello timer. */
|
||||
OSPF_ISM_TIMER_OFF(oi->t_hello);
|
||||
OSPF_HELLO_TIMER_ON(oi);
|
||||
}
|
||||
}
|
||||
|
||||
void ospf_if_init(void)
|
||||
{
|
||||
if_zapi_callbacks(ospf_ifp_create, ospf_ifp_up,
|
||||
|
|
|
@ -345,7 +345,8 @@ extern void ospf_if_set_multicast(struct ospf_interface *);
|
|||
extern void ospf_if_interface(struct interface *ifp);
|
||||
|
||||
extern uint32_t ospf_if_count_area_params(struct interface *ifp);
|
||||
|
||||
extern void ospf_reset_hello_timer(struct interface *ifp, struct in_addr addr,
|
||||
bool is_addr);
|
||||
DECLARE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd));
|
||||
DECLARE_HOOK(ospf_vl_delete, (struct ospf_vl_data * vd), (vd));
|
||||
|
||||
|
|
|
@ -8312,10 +8312,12 @@ DEFUN (ip_ospf_hello_interval,
|
|||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
int idx = 0;
|
||||
struct in_addr addr;
|
||||
struct in_addr addr = {.s_addr = 0L};
|
||||
struct ospf_if_params *params;
|
||||
params = IF_DEF_PARAMS(ifp);
|
||||
uint32_t seconds = 0;
|
||||
bool is_addr = false;
|
||||
uint32_t old_interval = 0;
|
||||
|
||||
argv_find(argv, argc, "(1-65535)", &idx);
|
||||
seconds = strtol(argv[idx]->arg, NULL, 10);
|
||||
|
@ -8329,8 +8331,15 @@ DEFUN (ip_ospf_hello_interval,
|
|||
|
||||
params = ospf_get_if_params(ifp, addr);
|
||||
ospf_if_update_params(ifp, addr);
|
||||
is_addr = true;
|
||||
}
|
||||
|
||||
old_interval = params->v_hello;
|
||||
|
||||
/* Return, if same interval is configured. */
|
||||
if (old_interval == seconds)
|
||||
return CMD_SUCCESS;
|
||||
|
||||
SET_IF_PARAM(params, v_hello);
|
||||
params->v_hello = seconds;
|
||||
|
||||
|
@ -8345,6 +8354,8 @@ DEFUN (ip_ospf_hello_interval,
|
|||
params->v_wait = 4 * seconds;
|
||||
}
|
||||
|
||||
ospf_reset_hello_timer(ifp, addr, is_addr);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -8371,7 +8382,7 @@ DEFUN (no_ip_ospf_hello_interval,
|
|||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
int idx = 0;
|
||||
struct in_addr addr;
|
||||
struct in_addr addr = {.s_addr = 0L};
|
||||
struct ospf_if_params *params;
|
||||
struct route_node *rn;
|
||||
|
||||
|
|
Loading…
Reference in New Issue