]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: Release last dbdesc packet after router dead interval
authorYash Ranjan <ranjany@vmware.com>
Tue, 16 Mar 2021 07:45:23 +0000 (00:45 -0700)
committerYash Ranjan <ranjany@vmware.com>
Sat, 19 Jun 2021 18:17:24 +0000 (11:17 -0700)
During the database description exchange process, the slave
releases the last dbdesc packet after router_dead_interval.
This was not implemented in the code.
I have written the function ospf6_neighbor_last_dbdesc_release,
which releases the last dbdesc packet after router_dead_interval.
This change was required as per the conformance test 13.11:

In state Full reception of a Database Description packet from
the master after this interval (RouterDeadInterval) will
generate a SeqNumberMismatch neighbor event.

Associated Parameters
  ICMPv6 Packet Listen Time
  ICMPv6 Packet Tolerance Factor
  ICMPv6 Packet Tolerance Time
  OSPFV3 DUT Interface Transmit Delay
  OSPF Reset Adjacencies Timeout
Test Actions
1.
2. 3.
ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0, with DUT as slave.
ANVL: Wait (for <RouterDeadInterval> seconds).
ANVL: Send <OSPF-DD> packet from neighbor Rtr-0-A to DIface-0 con- taining:
• •
I-bit field not set M-bit field not set
MS-bit field set
DD sequence number same as the one last sent by ANVL.

. ANVL: Listen (for upto 2 * <RxmtInterval> seconds) on DIface-0.
5. DUT: Trigger the event SeqNumberMismatch and set the neighbor state for neighbor Rtr-0-A to ExStart.
6. DUT: Send <OSPF-DD> packet.
7. ANVL: Verify that the received <OSPF-DD> packet contains:
• I-bit field set
• M-bit field set
• MS-bit field set.

Test Reference
• RFC 5340, s4.2.1.2 p19 Sending Database Description Packets
  RFC 2328, s10.8 p104 Sending Database Description Packets.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_neighbor.h

index 9323da8be3ed94a7673469a654cc5ce083d98b21..a08ca904eabe62e4b0ae0733a34126e4b3cf6fb7 100644 (file)
@@ -145,6 +145,8 @@ void ospf6_neighbor_delete(struct ospf6_neighbor *on)
 
        THREAD_OFF(on->inactivity_timer);
 
+       THREAD_OFF(on->last_dbdesc_release_timer);
+
        THREAD_OFF(on->thread_send_dbdesc);
        THREAD_OFF(on->thread_send_lsreq);
        THREAD_OFF(on->thread_send_lsupdate);
@@ -350,6 +352,16 @@ int negotiation_done(struct thread *thread)
        return 0;
 }
 
+static int ospf6_neighbor_last_dbdesc_release(struct thread *thread)
+{
+       struct ospf6_neighbor *on = THREAD_ARG(thread);
+
+       assert(on);
+       memset(&on->dbdesc_last, 0, sizeof(struct ospf6_dbdesc));
+
+       return 0;
+}
+
 int exchange_done(struct thread *thread)
 {
        struct ospf6_neighbor *on;
@@ -366,10 +378,13 @@ int exchange_done(struct thread *thread)
        THREAD_OFF(on->thread_send_dbdesc);
        ospf6_lsdb_remove_all(on->dbdesc_list);
 
-       /* XXX
-         thread_add_timer (master, ospf6_neighbor_last_dbdesc_release, on,
-                           on->ospf6_if->dead_interval);
-       */
+       /* RFC 2328 (10.8): Release the last dbdesc after dead_interval */
+       if (!CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)) {
+               THREAD_OFF(on->last_dbdesc_release_timer);
+               thread_add_timer(master, ospf6_neighbor_last_dbdesc_release, on,
+                                on->ospf6_if->dead_interval,
+                                &on->last_dbdesc_release_timer);
+       }
 
        if (on->request_list->count == 0)
                ospf6_neighbor_state_change(OSPF6_NEIGHBOR_FULL, on,
index 47f8c834e23dcca403da377d6478759f149e1574..85b8e4b8aecff3cdb489dff9bebec6be75fde450 100644 (file)
@@ -89,6 +89,9 @@ struct ospf6_neighbor {
        /* Inactivity timer */
        struct thread *inactivity_timer;
 
+       /* Timer to release the last dbdesc packet */
+       struct thread *last_dbdesc_release_timer;
+
        /* Thread for sending message */
        struct thread *thread_send_dbdesc;
        struct thread *thread_send_lsreq;