]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospf: optimization for FRR's P2MP mode
authorLou Berger <lberger@labn.net>
Fri, 21 Oct 2022 20:35:13 +0000 (20:35 +0000)
committerLou Berger <lberger@labn.net>
Tue, 25 Oct 2022 15:31:44 +0000 (15:31 +0000)
FRR implements a non-standard, but compatible approach for
sending update LSAs (it always send to 224.0.0.5) on P2MP
interfaces. This change makes it so acks are also sent to
224.0.0.5.

Since the acks are multicast, this allows an optimization
where we don't send back out the incoming P2MP interface
immediately allow time to rx multicast ack from neighbors
on the same net that rx'ed the original (multicast) update.

Signed-off-by: Lou Berger <lberger@labn.net>
ospfd/ospf_flood.c
ospfd/ospf_packet.c

index e686a93ba9f79afb2fc2dabcbf836267e7db6be0..c2af09a6796158230dcab683008e326c7659ef85 100644 (file)
@@ -648,6 +648,13 @@ int ospf_flood_through_interface(struct ospf_interface *oi,
                                                     OSPF_SEND_PACKET_DIRECT);
                }
        } else
+               /* Optimization: for P2MP interfaces,
+                  don't send back out the incoming interface immediately,
+                  allow time to rx multicast ack to the rx'ed (multicast)
+                  update */
+               if (retx_flag != 1 ||
+                   oi->type != OSPF_IFTYPE_POINTOMULTIPOINT || inbr == NULL ||
+                   oi != inbr->oi)
                ospf_ls_upd_send_lsa(oi->nbr_self, lsa,
                                     OSPF_SEND_PACKET_INDIRECT);
 
index 57643f637edaa240c49154d34d52f4c21ba66b26..466b5fa2a27cd062553eda548682465950b738d9 100644 (file)
@@ -4220,7 +4220,8 @@ static void ospf_ls_ack_send_list(struct ospf_interface *oi, struct list *ack,
        op->length = length;
 
        /* Decide destination address. */
-       if (oi->type == OSPF_IFTYPE_POINTOPOINT)
+       if (oi->type == OSPF_IFTYPE_POINTOPOINT ||
+           oi->type == OSPF_IFTYPE_POINTOMULTIPOINT)
                op->dst.s_addr = htonl(OSPF_ALLSPFROUTERS);
        else
                op->dst.s_addr = dst.s_addr;