ospfd: api: always ready to receive opaque from client

Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
Christian Hopps 2022-01-25 04:53:53 -05:00
parent 97355a6d92
commit bd1188f904

View file

@ -1562,45 +1562,20 @@ struct ospf_lsa *ospf_apiserver_opaque_lsa_new(struct ospf_area *area,
int ospf_apiserver_is_ready_type9(struct ospf_interface *oi) int ospf_apiserver_is_ready_type9(struct ospf_interface *oi)
{ {
/* Type 9 opaque LSA can be originated if there is at least one /* We can always handle getting opaque's even if we can't flood them */
active opaque-capable neighbor attached to the outgoing return 1;
interface. */
return (ospf_nbr_count_opaque_capable(oi) > 0);
} }
int ospf_apiserver_is_ready_type10(struct ospf_area *area) int ospf_apiserver_is_ready_type10(struct ospf_area *area)
{ {
/* Type 10 opaque LSA can be originated if there is at least one /* We can always handle getting opaque's even if we can't flood them */
interface belonging to the area that has an active opaque-capable return 1;
neighbor. */
struct listnode *node, *nnode;
struct ospf_interface *oi;
for (ALL_LIST_ELEMENTS(area->oiflist, node, nnode, oi))
/* Is there an active neighbor attached to this interface? */
if (ospf_apiserver_is_ready_type9(oi))
return 1;
/* No active neighbor in area */
return 0;
} }
int ospf_apiserver_is_ready_type11(struct ospf *ospf) int ospf_apiserver_is_ready_type11(struct ospf *ospf)
{ {
/* Type 11 opaque LSA can be originated if there is at least one /* We can always handle getting opaque's even if we can't flood them */
interface return 1;
that has an active opaque-capable neighbor. */
struct listnode *node, *nnode;
struct ospf_interface *oi;
for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi))
/* Is there an active neighbor attached to this interface? */
if (ospf_apiserver_is_ready_type9(oi))
return 1;
/* No active neighbor at all */
return 0;
} }