summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_lsa.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2010-04-15 09:11:51 +0200
committerPaul Jakma <paul@quagga.net>2010-12-08 18:13:19 +0100
commit4dd87df5af8a59174362e44f83df11f12457c8b4 (patch)
treebec3ba26fcf730d6348567ddd530e74846af824b /ospfd/ospf_lsa.c
parentospfd: potential fix for router-id change assert on refresh cleanup patch (diff)
downloadfrr-4dd87df5af8a59174362e44f83df11f12457c8b4.tar.xz
frr-4dd87df5af8a59174362e44f83df11f12457c8b4.zip
ospfd: Remove oi field from LSA, have network_lsa_refresh look up when needed
* ospf_lsa.h: (struct ospf_lsa) remove oi pointer * ospf_lsa.c: (ospf_network_lsa_refresh) instead of keeping a pointer, just lookup the oi when it's needed. This decouples network LSA from oi lifetime and avoids having to invalidate pointers in LSAs when an oi changes, simplifying the code.
Diffstat (limited to 'ospfd/ospf_lsa.c')
-rw-r--r--ospfd/ospf_lsa.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 7e71b5d78..842df49c0 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -1045,7 +1045,6 @@ ospf_network_lsa_new (struct ospf_interface *oi)
}
new->area = oi->area;
- new->oi = oi;
SET_FLAG (new->flags, OSPF_LSA_SELF | OSPF_LSA_SELF_CHECKED);
/* Copy LSA to store. */
@@ -1114,10 +1113,23 @@ ospf_network_lsa_refresh (struct ospf_lsa *lsa)
struct ospf_area *area = lsa->area;
struct ospf_lsa *new, *new2;
struct ospf_if_params *oip;
- struct ospf_interface *oi = lsa->oi;
+ struct ospf_interface *oi;
assert (lsa->data);
-
+
+ /* Retrieve the oi for the network LSA */
+ oi = ospf_if_lookup_by_local_addr (area->ospf, NULL, lsa->data->id);
+ if (oi == NULL)
+ {
+ if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
+ {
+ zlog_debug ("LSA[Type%d:%s]: network-LSA refresh: "
+ "no oi found, ick, ignoring.",
+ lsa->data->type, inet_ntoa (lsa->data->id));
+ ospf_lsa_header_dump (lsa->data);
+ }
+ return NULL;
+ }
/* Delete LSA from neighbor retransmit-list. */
ospf_ls_retransmit_delete_nbr_area (area, lsa);