diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2021-08-19 15:01:34 -0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-19 15:01:34 -0300 | 
| commit | f70b917249b783c47ef8e8c0575374a6207a2baa (patch) | |
| tree | fe0ea3b9e5d877f629d7fabe88de2f7545e67626 /ospf6d/ospf6_flood.c | |
| parent | 2cb694ba131b5e543ce16d77f452c6296c978c13 (diff) | |
| parent | 0fc3e113231829c3412f5009be2b4c790b444bd3 (diff) | |
Merge pull request #8935 from rgirada/ospfv3_gr_helper
ospf6d: Support for ospfv3  graceful restart  helper functionality
Diffstat (limited to 'ospf6d/ospf6_flood.c')
| -rw-r--r-- | ospf6d/ospf6_flood.c | 61 | 
1 files changed, 61 insertions, 0 deletions
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 5a4dd72b66..f13ed3e3bb 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -41,6 +41,7 @@  #include "ospf6_flood.h"  #include "ospf6_nssa.h" +#include "ospf6_gr.h"  unsigned char conf_debug_ospf6_flooding; @@ -323,6 +324,22 @@ void ospf6_install_lsa(struct ospf6_lsa *lsa)  	/* actually install */  	lsa->installed = now; + +	/* Topo change handling */ +	if (CHECK_LSA_TOPO_CHG_ELIGIBLE(ntohs(lsa->header->type))) { + +		/* check if it is new lsa ? or existing lsa got modified ?*/ +		if (!old || OSPF6_LSA_IS_CHANGED(old, lsa)) { +			struct ospf6 *ospf6; + +			ospf6 = ospf6_get_by_lsdb(lsa); + +			assert(ospf6); + +			ospf6_helper_handle_topo_chg(ospf6, lsa); +		} +	} +  	ospf6_lsdb_add(lsa, lsa->lsdb);  	if (ntohs(lsa->header->type) == OSPF6_LSTYPE_TYPE_7) { @@ -1016,6 +1033,50 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,  		    != from->ospf6_if->area->ospf6->router_id)  			ospf6_flood(from, new); +		/* Received Grace-LSA */ +		if (IS_GRACE_LSA(new)) { +			struct ospf6 *ospf6; + +			ospf6 = ospf6_get_by_lsdb(new); + +			assert(ospf6); + +			if (OSPF6_LSA_IS_MAXAGE(new)) { + +				if (IS_DEBUG_OSPF6_GR) +					zlog_debug( +						"%s, Received a maxage GraceLSA from router %pI4", +						__func__, +						&new->header->adv_router); +				if (old) { +					ospf6_process_maxage_grace_lsa( +						ospf6, new, from); +				} else { +					if (IS_DEBUG_OSPF6_GR) +						zlog_debug( +							"%s, GraceLSA doesn't exist in lsdb, so discarding GraceLSA", +							__func__); +					return; +				} +			} else { + +				if (IS_DEBUG_OSPF6_GR) +					zlog_debug( +						"%s, Received a GraceLSA from router %pI4", +						__func__, +						&new->header->adv_router); + +				if (ospf6_process_grace_lsa(ospf6, new, from) +				    == OSPF6_GR_NOT_HELPER) { +					if (IS_DEBUG_OSPF6_GR) +						zlog_debug( +							"%s, Not moving to HELPER role, So dicarding GraceLSA", +							__func__); +					return; +				} +			} +		} +  		/* (d), installing lsdb, which may cause routing  			table calculation (replacing database copy) */  		ospf6_install_lsa(new);  | 
