]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: send ARP requests using zebra 6869/head
authorJakub Urbańczyk <xthaid@gmail.com>
Thu, 6 Aug 2020 11:36:22 +0000 (13:36 +0200)
committerJakub Urbańczyk <xthaid@gmail.com>
Wed, 12 Aug 2020 21:20:52 +0000 (23:20 +0200)
Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
ospfd/ospf_packet.c
ospfd/ospf_zebra.c
ospfd/ospf_zebra.h

index b0dd5c6fc2b1813d5c05bb4e1c461f0406625305..49cd42d030bf4e2f775c49d13fc96062940e752e 100644 (file)
@@ -53,6 +53,7 @@
 #include "ospfd/ospf_flood.h"
 #include "ospfd/ospf_dump.h"
 #include "ospfd/ospf_errors.h"
+#include "ospfd/ospf_zebra.h"
 
 /*
  * OSPF Fragmentation / fragmented writes
@@ -4319,21 +4320,10 @@ void ospf_ls_ack_send_delayed(struct ospf_interface *oi)
  * 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  (BUFSIZ)
 void ospf_proactively_arp(struct ospf_neighbor *nbr)
 {
-       char ping_nbr[OSPF_PING_NBR_STR_MAX];
-       int ret;
-
        if (!nbr)
                return;
 
-       snprintf(ping_nbr, sizeof(ping_nbr),
-                "ping -c 1 -I %s %s > /dev/null 2>&1 &", nbr->oi->ifp->name,
-                inet_ntoa(nbr->address.u.prefix4));
-
-       ret = system(ping_nbr);
-       if (IS_DEBUG_OSPF_EVENT)
-               zlog_debug("Executed %s %s", ping_nbr,
-                          ((ret == 0) ? "successfully" : "but failed"));
+       ospf_zebra_send_arp(nbr->oi->ifp, &nbr->address);
 }
index 84bdb9ec5b2f2cc7ef150afcaa058d09a7fa36e5..2b8769a4a87b1848fde93880ab87945041b1eb84 100644 (file)
@@ -1741,3 +1741,8 @@ void ospf_zebra_init(struct thread_master *master, unsigned short instance)
        prefix_list_add_hook(ospf_prefix_list_update);
        prefix_list_delete_hook(ospf_prefix_list_update);
 }
+
+void ospf_zebra_send_arp(const struct interface *ifp, const struct prefix *p)
+{
+       zclient_send_neigh_discovery_req(zclient, ifp, p);
+}
index 80abf62369abb3fec9fb29af5f909be71c5efafe..6a79f39fa40585ca2c3502ec339e963799b474ba 100644 (file)
@@ -41,6 +41,7 @@ struct ospf_distance {
 };
 
 /* Prototypes */
+struct ospf_route;
 extern void ospf_zebra_add(struct ospf *ospf, struct prefix_ipv4 *,
                           struct ospf_route *);
 extern void ospf_zebra_delete(struct ospf *ospf, struct prefix_ipv4 *,
@@ -98,4 +99,7 @@ bool ospf_external_default_routemap_apply_walk(
 int ospf_external_info_apply_default_routemap(struct ospf *ospf,
                                              struct external_info *ei,
                                              struct external_info *default_ei);
+
+extern void ospf_zebra_send_arp(const struct interface *ifp,
+                               const struct prefix *p);
 #endif /* _ZEBRA_OSPF_ZEBRA_H */