ospfd: Compile fix for opaque support
* ospfd: Refresher logic cleanup broke OSPF opaque, which does its own thing
with regard to refresher logic and which also, in the protocol, requires
implementations to keep state of which OI an LSA is received on (rather
than providing information in the LSA to allow it to be looked up - as
other LSAs requiring such assocation were careful to do).
* ospf_lsa.h: (struct ospf_interface) Add back the pointer to oi, but only
for type-9 now.
* ospf_nsm.c: (ospf_db_summary_add) check the oi actually exists first -
doesn't obviate the need for opaque to ensure oi pointers get cleaned up
when ospf_interfaces disappear.
* ospf_opaque.{c,h}: (ospf_opaque_functab,ospf_opaque_lsa_refresh) Refresher
LSA functions now need to return the LSA to the general refresh logic,
to indicate whether the LSA was refreshed.
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 6e90011..aa126e1 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -251,7 +251,7 @@
void (* config_write_debug )(struct vty *vty);
void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa);
int (* lsa_originator)(void *arg);
- void (* lsa_refresher )(struct ospf_lsa *lsa);
+ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa);
int (* new_lsa_hook)(struct ospf_lsa *lsa);
int (* del_lsa_hook)(struct ospf_lsa *lsa);
};
@@ -354,7 +354,7 @@
void (* config_write_debug )(struct vty *vty),
void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa),
int (* lsa_originator)(void *arg),
- void (* lsa_refresher )(struct ospf_lsa *lsa),
+ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
int (* new_lsa_hook)(struct ospf_lsa *lsa),
int (* del_lsa_hook)(struct ospf_lsa *lsa))
{
@@ -1608,12 +1608,13 @@
return new;
}
-void
+struct ospf_lsa *
ospf_opaque_lsa_refresh (struct ospf_lsa *lsa)
{
struct ospf *ospf;
struct ospf_opaque_functab *functab;
-
+ struct ospf_lsa *new = NULL;
+
ospf = ospf_lookup ();
if ((functab = ospf_opaque_functab_lookup (lsa)) == NULL
@@ -1633,9 +1634,9 @@
ospf_lsa_flush (ospf, lsa);
}
else
- (* functab->lsa_refresher)(lsa);
+ new = (* functab->lsa_refresher)(lsa);
- return;
+ return new;
}
/*------------------------------------------------------------------------*