ospfd: Fix initial Opaque LSA DB synchronisation

ospfd has issues resynchronising its Opaque LSA DB with neighbours after restart
or interface events. The problem comes from opaque_lsa.c code that blocks
subsequent opaque LSA flooding until the neighbour router acknowledge that, and
removes the old opaque LSA from its LSDB. The bug comes from the fact that the
lock is never release, thus avoiding subsequent opaque LSA flooding.

More detail about the bugs and its solution is describeid in file
doc/te-link-params.md

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
(cherry picked from commit 149210656045c363d8f59b97ad9251b0c06a15df)
This commit is contained in:
Olivier Dugeon 2014-11-03 14:59:06 +01:00 committed by Daniel Walton
parent de111d75a9
commit f7c7e4f092

View File

@ -2132,10 +2132,12 @@ out:
*------------------------------------------------------------------------*/
static void ospf_opaque_exclude_lsa_from_lsreq (struct route_table *nbrs, struct ospf_neighbor *inbr, struct ospf_lsa *lsa);
#ifdef BUGGY_UNLOCK
static void ospf_opaque_type9_lsa_rxmt_nbr_check (struct ospf_interface *oi);
static void ospf_opaque_type10_lsa_rxmt_nbr_check (struct ospf_area *area);
static void ospf_opaque_type11_lsa_rxmt_nbr_check (struct ospf *top);
static unsigned long ospf_opaque_nrxmt_self (struct route_table *nbrs, int lsa_type);
#endif /* BUGGY_UNLOCK */
void
ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr, struct list *lsas)
@ -2302,17 +2304,20 @@ ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
{
case OSPF_OPAQUE_LINK_LSA:
if (CHECK_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_09_LSA_BIT))
ospf_opaque_type9_lsa_rxmt_nbr_check (nbr->oi);
UNSET_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_09_LSA_BIT);
/* BUGGY_UNLOCK: ospf_opaque_type9_lsa_rxmt_nbr_check (nbr->oi); */
/* Callback function... */
break;
case OSPF_OPAQUE_AREA_LSA:
if (CHECK_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_10_LSA_BIT))
ospf_opaque_type10_lsa_rxmt_nbr_check (nbr->oi->area);
UNSET_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_10_LSA_BIT);
/* BUGGY_UNLOCK: ospf_opaque_type10_lsa_rxmt_nbr_check (nbr->oi->area); */
/* Callback function... */
break;
case OSPF_OPAQUE_AS_LSA:
if (CHECK_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_11_LSA_BIT))
ospf_opaque_type11_lsa_rxmt_nbr_check (top);
UNSET_FLAG (top->opaque, OPAQUE_BLOCK_TYPE_11_LSA_BIT);
/* BUGGY_UNLOCK: ospf_opaque_type11_lsa_rxmt_nbr_check (top); */
/* Callback function... */
break;
default:
@ -2321,11 +2326,10 @@ ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
}
if (IS_OPAQUE_LSA_ORIGINATION_BLOCKED (top->opaque))
{
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("Block Opaque-LSA origination: ON -> OFF");
return; /* Blocking still in progress. */
}
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("Block Opaque-LSA origination: ON -> OFF");
if (! CHECK_FLAG (top->config, OSPF_OPAQUE_CAPABLE))
return; /* Opaque capability condition must have changed. */
@ -2345,6 +2349,7 @@ ospf_opaque_ls_ack_received (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
return;
}
#ifdef BUGGY_UNLOCK
static void
ospf_opaque_type9_lsa_rxmt_nbr_check (struct ospf_interface *oi)
{
@ -2445,6 +2450,7 @@ ospf_opaque_nrxmt_self (struct route_table *nbrs, int lsa_type)
return n;
}
#endif /* BUGGY_UNLOCK */
/*------------------------------------------------------------------------*
* Followings are util functions; probably be used by Opaque-LSAs only...