diff options
Diffstat (limited to 'ospfd')
| -rw-r--r-- | ospfd/ospf_lsa.c | 9 | ||||
| -rw-r--r-- | ospfd/ospf_vty.c | 7 | ||||
| -rw-r--r-- | ospfd/ospfd.c | 7 |
3 files changed, 15 insertions, 8 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index f175bbf9e4..1350487898 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -106,7 +106,7 @@ int tv2msec(struct timeval tv) int msecs; msecs = tv.tv_sec * 1000; - msecs += tv.tv_usec / 1000; + msecs += (tv.tv_usec + 1000) / 1000; return msecs; } @@ -126,7 +126,12 @@ int ospf_lsa_refresh_delay(struct ospf *ospf, struct ospf_lsa *lsa) zlog_debug("LSA[Type%d:%pI4]: Refresh timer delay %d milliseconds", lsa->data->type, &lsa->data->id, delay); - assert(delay > 0); + if (delay <= 0) { + zlog_warn("LSA[Type%d:%pI4]: Invalid refresh timer delay %d milliseconds Seq: 0x%x Age:%u", + lsa->data->type, &lsa->data->id, delay, + ntohl(lsa->data->ls_seqnum), ntohs(lsa->data->ls_age)); + delay = 0; + } } return delay; diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 428d92dd0c..0457b13337 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -339,6 +339,12 @@ DEFPY (no_ospf_router_id, return CMD_SUCCESS; } +ALIAS_HIDDEN (no_ospf_router_id, + no_router_id_cmd, + "no router-id [A.B.C.D]", + NO_STR + "router-id for the OSPF process\n" + "OSPF router-id in IP address format\n") static void ospf_passive_interface_default_update(struct ospf *ospf, uint8_t newval) @@ -13603,6 +13609,7 @@ void ospf_vty_init(void) install_element(OSPF_NODE, &ospf_router_id_cmd); install_element(OSPF_NODE, &ospf_router_id_old_cmd); install_element(OSPF_NODE, &no_ospf_router_id_cmd); + install_element(OSPF_NODE, &no_router_id_cmd); /* "passive-interface" commands. */ install_element(OSPF_NODE, &ospf_passive_interface_default_cmd); diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 7638e979a2..d72afec1e4 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -147,15 +147,10 @@ void ospf_process_refresh_data(struct ospf *ospf, bool reset) /* Select the router ID based on these priorities: 1. Statically assigned router ID is always the first choice. - 2. If there is no statically assigned router ID, then try to stick - with the most recent value, since changing router ID's is very - disruptive. - 3. Last choice: just go with whatever the zebra daemon recommends. + 2. Just go with whatever the zebra daemon recommends. */ if (ospf->router_id_static.s_addr != INADDR_ANY) router_id = ospf->router_id_static; - else if (ospf->router_id.s_addr != INADDR_ANY) - router_id = ospf->router_id; else router_id = ospf->router_id_zebra; |
