mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 14:34:22 +00:00
Merge pull request #11030 from ranjanyash54/minls
ospf6d: Check for MinLSInterval timer when adding to LSUpdate list
This commit is contained in:
commit
2e4b21fc58
@ -878,6 +878,28 @@ static int ospf6_is_maxage_lsa_drop(struct ospf6_lsa *lsa,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool ospf6_lsa_check_min_arrival(struct ospf6_lsa *lsa,
|
||||||
|
struct ospf6_neighbor *from)
|
||||||
|
{
|
||||||
|
struct timeval now, res;
|
||||||
|
unsigned int time_delta_ms;
|
||||||
|
|
||||||
|
monotime(&now);
|
||||||
|
timersub(&now, &lsa->installed, &res);
|
||||||
|
time_delta_ms = (res.tv_sec * 1000) + (int)(res.tv_usec / 1000);
|
||||||
|
|
||||||
|
if (time_delta_ms < from->ospf6_if->area->ospf6->lsa_minarrival) {
|
||||||
|
if (IS_OSPF6_DEBUG_FLOODING ||
|
||||||
|
IS_OSPF6_DEBUG_FLOOD_TYPE(lsa->header->type))
|
||||||
|
zlog_debug(
|
||||||
|
"LSA can't be updated within MinLSArrival, %dms < %dms, discard",
|
||||||
|
time_delta_ms,
|
||||||
|
from->ospf6_if->area->ospf6->lsa_minarrival);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* RFC2328 section 13 The Flooding Procedure */
|
/* RFC2328 section 13 The Flooding Procedure */
|
||||||
void ospf6_receive_lsa(struct ospf6_neighbor *from,
|
void ospf6_receive_lsa(struct ospf6_neighbor *from,
|
||||||
struct ospf6_lsa_header *lsa_header)
|
struct ospf6_lsa_header *lsa_header)
|
||||||
@ -885,7 +907,6 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
|
|||||||
struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL;
|
struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL;
|
||||||
int ismore_recent;
|
int ismore_recent;
|
||||||
int is_debug = 0;
|
int is_debug = 0;
|
||||||
unsigned int time_delta_ms;
|
|
||||||
|
|
||||||
ismore_recent = 1;
|
ismore_recent = 1;
|
||||||
assert(from);
|
assert(from);
|
||||||
@ -993,19 +1014,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
|
|||||||
|
|
||||||
/* (a) MinLSArrival check */
|
/* (a) MinLSArrival check */
|
||||||
if (old) {
|
if (old) {
|
||||||
struct timeval now, res;
|
if (ospf6_lsa_check_min_arrival(old, from)) {
|
||||||
monotime(&now);
|
|
||||||
timersub(&now, &old->installed, &res);
|
|
||||||
time_delta_ms =
|
|
||||||
(res.tv_sec * 1000) + (int)(res.tv_usec / 1000);
|
|
||||||
if (time_delta_ms
|
|
||||||
< from->ospf6_if->area->ospf6->lsa_minarrival) {
|
|
||||||
if (is_debug)
|
|
||||||
zlog_debug(
|
|
||||||
"LSA can't be updated within MinLSArrival, %dms < %dms, discard",
|
|
||||||
time_delta_ms,
|
|
||||||
from->ospf6_if->area->ospf6
|
|
||||||
->lsa_minarrival);
|
|
||||||
ospf6_lsa_delete(new);
|
ospf6_lsa_delete(new);
|
||||||
return; /* examin next lsa */
|
return; /* examin next lsa */
|
||||||
}
|
}
|
||||||
@ -1222,7 +1231,11 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
|
|||||||
__PRETTY_FUNCTION__, old->name);
|
__PRETTY_FUNCTION__, old->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX, MinLSArrival check !? RFC 2328 13 (8) */
|
/* MinLSArrival check as per RFC 2328 13 (8) */
|
||||||
|
if (ospf6_lsa_check_min_arrival(old, from)) {
|
||||||
|
ospf6_lsa_delete(new);
|
||||||
|
return; /* examin next lsa */
|
||||||
|
}
|
||||||
|
|
||||||
ospf6_lsdb_add(ospf6_lsa_copy(old),
|
ospf6_lsdb_add(ospf6_lsa_copy(old),
|
||||||
from->lsupdate_list);
|
from->lsupdate_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user