summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_spf.c
diff options
context:
space:
mode:
authorMitesh Kanjariya <mitesh@cumulusnetworks.com>2018-02-21 00:36:58 -0800
committerGitHub <noreply@github.com>2018-02-21 00:36:58 -0800
commitf487dcaf74c9bd7a716a749d15281d5b92d363d4 (patch)
tree5362b8a4081b3b8a13038fa520c8d66a95c0192e /ospf6d/ospf6_spf.c
parent7fdaec88941d66d831363d32084cc88c5b98ac6c (diff)
parent4298f5e937a1fa689047697395f8b741fb9b3d15 (diff)
Merge branch 'master' into evpn-bug-fixes
Diffstat (limited to 'ospf6d/ospf6_spf.c')
-rw-r--r--ospf6d/ospf6_spf.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 17ce1771e2..29ba1bcec7 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -1029,18 +1029,21 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
/* Fill Larger LSA Payload */
end = ospf6_lsdb_head(lsdb, 2, type, adv_router, &rtr_lsa);
- if (rtr_lsa) {
- if (!OSPF6_LSA_IS_MAXAGE(rtr_lsa)) {
- /* Append first Link State ID LSA */
- lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
- memcpy(new_header, lsa_header,
- ntohs(lsa_header->length));
- /* Assign new lsa length as aggregated length. */
- ((struct ospf6_lsa_header *)new_header)->length =
- htons(total_lsa_length);
- new_header += ntohs(lsa_header->length);
- num_lsa--;
- }
+
+ /*
+ * We assume at this point in time that rtr_lsa is
+ * a valid pointer.
+ */
+ assert(rtr_lsa);
+ if (!OSPF6_LSA_IS_MAXAGE(rtr_lsa)) {
+ /* Append first Link State ID LSA */
+ lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
+ memcpy(new_header, lsa_header, ntohs(lsa_header->length));
+ /* Assign new lsa length as aggregated length. */
+ ((struct ospf6_lsa_header *)new_header)->length =
+ htons(total_lsa_length);
+ new_header += ntohs(lsa_header->length);
+ num_lsa--;
}
/* Print LSA Name */