summaryrefslogtreecommitdiff
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 17:24:41 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 17:24:41 -0700
commit8b6912c2ffec50ef001cea062448ea3058d512e8 (patch)
tree9063d834289c97154a3ef025a6bee6202fd2ec0e /ospfd/ospf_packet.c
parent9343ce8356304024ef946e7c1049de378eededb2 (diff)
Send ARP requests proactively during OSPF Adjacency formation.
Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com> Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com> Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index efdf8263b7..4b4a61a6e8 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -3960,3 +3960,35 @@ ospf_ls_ack_send_delayed (struct ospf_interface *oi)
while (listcount (oi->ls_ack))
ospf_ls_ack_send_list (oi, oi->ls_ack, dst);
}
+
+/*
+ * On pt-to-pt links, all OSPF control packets are sent to the multicast
+ * address. As a result, the kernel does not need to learn the interface
+ * MAC of the OSPF neighbor. However, in our world, this will delay
+ * convergence. Take the case when due to a link flap, all routes now
+ * want to use an interface which was deemed to be costlier prior to this
+ * event. For routes that will be installed, the missing MAC will have
+ * punt-to-CPU set on them. This may overload the CPU control path that
+ * can be avoided if the MAC was known apriori.
+ */
+#define OSPF_PING_NBR_STR_MAX (8 + 40 + 20)
+void
+ospf_proactively_arp (struct ospf_neighbor *nbr)
+{
+ char ping_nbr[OSPF_PING_NBR_STR_MAX];
+ char *str_ptr;
+ int ret;
+
+ if (!nbr || !nbr->oi || !nbr->oi->ifp || !nbr->oi->ifp->name)
+ return;
+
+ str_ptr = strcpy (ping_nbr, "ping -c 1 -I ");
+ str_ptr = strcat (str_ptr, nbr->oi->ifp->name);
+ str_ptr = strcat (str_ptr, " ");
+ str_ptr = strcat (str_ptr, inet_ntoa (nbr->address.u.prefix4));
+ str_ptr = strcat (str_ptr, " > /dev/null 2>&1 &");
+ ret = system (ping_nbr);
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug ("Executed %s %s", ping_nbr,
+ ((ret == 0) ? "successfully" : "but failed"));
+}