From cb1f47c2eb46c3ca7bd485c15fed024f31c50be6 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 1 Mar 2023 17:31:56 -0300 Subject: ospfd, ospf6d: perform GR consistency check only when necessary The GR code should check for topology changes only upon the receipt of Router-LSAs and Network-LSAs. Other LSAs types don't affect the topology as far as a restarting router is concerned. This optimization reduces unnecessary computations when the restarting router receives thousands of inter-area LSAs or external LSAs while coming back up. Signed-off-by: Renato Westphal --- ospf6d/ospf6_flood.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ospf6d/ospf6_flood.c') diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 2d2069566..db1520ff2 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -1105,9 +1105,12 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from, &new->refresh); } + /* GR: check for network topology change. */ struct ospf6 *ospf6 = from->ospf6_if->area->ospf6; struct ospf6_area *area = from->ospf6_if->area; - if (ospf6->gr_info.restart_in_progress) + if (ospf6->gr_info.restart_in_progress && + (new->header->type == ntohs(OSPF6_LSTYPE_ROUTER) || + new->header->type == ntohs(OSPF6_LSTYPE_NETWORK))) ospf6_gr_check_lsdb_consistency(ospf6, area); return; -- cgit v1.2.3