]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: Send Link LSAs when interface priority is changed 8504/head
authorYash Ranjan <ranjany@vmware.com>
Fri, 9 Apr 2021 07:51:00 +0000 (00:51 -0700)
committerYash Ranjan <ranjany@vmware.com>
Sun, 2 May 2021 17:19:16 +0000 (10:19 -0700)
As per the ospfv3 conformance test 24.3

SETUP: Configure DIface-0 with priority set to <hprty>.
ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0.
DUT: Exchange all the <OSPF-DD> packets, during adjacency establish- ment.
ANVL: Verify that the received <OSPF-DD> packets contain: • one header of Link-LSA, originated by DUT.
ANVL: Send <OSPF-LSR> packet from neighbor Rtr-0-A to DIface-0 con- taining:
• One Request Tuple for Link-LSA originated by DUT.
ANVL: Listen (for upto 2 * <RxmtInterval> seconds) on DIface-0. DUT: Send <OSPF-LSU> packet.
ANVL: Verify that the received <OSPF-LSU> packet contains:
• •
one Link-LSA, originated by DUT, contains: Rtr Pri field set to <hprty>.
----------
When interface priority is changed Link LSAs should be tranmitted
with the priority set.

When the link priorty chanages, the drbdr algorithm is called, which
can change the state of the interface. But if the state does not
changes then LINK LSAs are not transmitted.

This PR fixes this issue. If the state is changed, then LINK LSAs
will anyways be tranmitted. But in case the state is not changed,
even in that case Link LSAs are tranmitted.

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

index f3af8b308f16e82a4666fc96ee1c1bb74451bbea..a2ddba65e9723a2268338cfd6c7a501b85080439 100644 (file)
@@ -474,8 +474,8 @@ void ospf6_interface_connected_route_update(struct interface *ifp)
        OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi->area);
 }
 
-static void ospf6_interface_state_change(uint8_t next_state,
-                                        struct ospf6_interface *oi)
+static int ospf6_interface_state_change(uint8_t next_state,
+                                       struct ospf6_interface *oi)
 {
        uint8_t prev_state;
        struct ospf6 *ospf6;
@@ -484,7 +484,7 @@ static void ospf6_interface_state_change(uint8_t next_state,
        oi->state = next_state;
 
        if (prev_state == next_state)
-               return;
+               return -1;
 
        /* log */
        if (IS_OSPF6_DEBUG_INTERFACE) {
@@ -525,6 +525,8 @@ static void ospf6_interface_state_change(uint8_t next_state,
        }
 
        hook_call(ospf6_interface_change, oi, next_state, prev_state);
+
+       return 0;
 }
 
 
@@ -1902,10 +1904,13 @@ DEFUN (ipv6_ospf6_priority,
                               ? OSPF6_INTERFACE_PRIORITY
                               : strtoul(argv[idx_number]->arg, NULL, 10);
 
-       if (oi->area && (oi->state == OSPF6_INTERFACE_DROTHER
-                        || oi->state == OSPF6_INTERFACE_BDR
-                        || oi->state == OSPF6_INTERFACE_DR))
-               ospf6_interface_state_change(dr_election(oi), oi);
+       if (oi->area
+           && (oi->state == OSPF6_INTERFACE_DROTHER
+               || oi->state == OSPF6_INTERFACE_BDR
+               || oi->state == OSPF6_INTERFACE_DR)) {
+               if (ospf6_interface_state_change(dr_election(oi), oi) == -1)
+                       OSPF6_LINK_LSA_SCHEDULE(oi);
+       }
 
        return CMD_SUCCESS;
 }