diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 5122175..1187282 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -1051,31 +1051,23 @@ #endif /* HAVE_OPAQUE_LSA */ } } - /* Master */ - if (IS_SET_DD_MS (nbr->dd_flags)) - { - nbr->dd_seqnum++; - /* Entire DD packet sent. */ - if (!IS_SET_DD_M (dd->flags) && !IS_SET_DD_M (nbr->dd_flags)) - OSPF_NSM_EVENT_SCHEDULE (nbr, NSM_ExchangeDone); - else - /* Send new DD packet. */ - ospf_db_desc_send (nbr); - } - /* Slave */ + /* Update DD Sequence number */ + if (IS_SET_DD_MS (nbr->dd_flags)) /* Master */ + nbr->dd_seqnum++; + else /* Slave */ + nbr->dd_seqnum = ntohl (dd->dd_seqnum); + + /* Any more DB-summaries to exchange? */ + if (IS_SET_DD_M (dd->flags) || IS_SET_DD_M (nbr->dd_flags)) + ospf_db_desc_send (nbr); else { - nbr->dd_seqnum = ntohl (dd->dd_seqnum); - - /* When master's more flags is not set. */ - if (!IS_SET_DD_M (dd->flags) && ospf_db_summary_isempty (nbr)) - { - nbr->dd_flags &= ~(OSPF_DD_FLAG_M); - OSPF_NSM_EVENT_SCHEDULE (nbr, NSM_ExchangeDone); - } - - /* Send DD packet in reply. */ - ospf_db_desc_send (nbr); + /* Both sides have sent with More-bit clear: Exchange is done */ + OSPF_NSM_EVENT_SCHEDULE (nbr, NSM_ExchangeDone); + + /* Slave must still send a DB-Desc, to acknowledge the masters packet */ + if (!IS_SET_DD_MS (nbr->dd_flags)) + ospf_db_desc_send (nbr); } /* Save received neighbor values from DD. */