]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: make proactive ARP configurable
authorJakub Urbańczyk <xthaid@gmail.com>
Wed, 19 Aug 2020 12:19:19 +0000 (14:19 +0200)
committerJakub Urbańczyk <xthaid@gmail.com>
Thu, 20 Aug 2020 15:19:25 +0000 (17:19 +0200)
OSPFD sends ARP proactively to speed up convergence for /32 networks
on a p2p connection. It is only an optimization, so it can be disabled.

It is enabled by default.

Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
ospfd/ospf_packet.c
ospfd/ospf_vty.c
ospfd/ospfd.c
ospfd/ospfd.h
yang/frr-ospfd.yang

index 49cd42d030bf4e2f775c49d13fc96062940e752e..61aae695b3baa7c0086f38dbbb539a9dad5b3d0e 100644 (file)
@@ -4322,7 +4322,7 @@ void ospf_ls_ack_send_delayed(struct ospf_interface *oi)
  */
 void ospf_proactively_arp(struct ospf_neighbor *nbr)
 {
-       if (!nbr)
+       if (!nbr || !nbr->oi->ospf->proactive_arp)
                return;
 
        ospf_zebra_send_arp(nbr->oi->ifp, &nbr->address);
index e8cc50c8d040cf0f99cc431e342209b3d1f593b7..8be7748c8775781625a78bc8e1a279ad8875a9d5 100644 (file)
@@ -8925,6 +8925,31 @@ DEFUN (no_ospf_max_metric_router_lsa_shutdown,
        return CMD_SUCCESS;
 }
 
+DEFUN (ospf_proactive_arp,
+       ospf_proactive_arp_cmd,
+       "proactive-arp",
+       "Allow sending ARP requests proactively\n")
+{
+       VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf);
+
+       ospf->proactive_arp = true;
+
+       return CMD_SUCCESS;
+}
+
+DEFUN (no_ospf_proactive_arp,
+       no_ospf_proactive_arp_cmd,
+       "no proactive-arp",
+          NO_STR
+       "Disallow sending ARP requests proactively\n")
+{
+       VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf);
+
+       ospf->proactive_arp = false;
+
+       return CMD_SUCCESS;
+}
+
 static void config_write_stub_router(struct vty *vty, struct ospf *ospf)
 {
        struct listnode *ln;
@@ -10415,6 +10440,14 @@ static int ospf_config_write_one(struct vty *vty, struct ospf *ospf)
        if (ospf->passive_interface_default == OSPF_IF_PASSIVE)
                vty_out(vty, " passive-interface default\n");
 
+       /* proactive-arp print. */
+       if (ospf->proactive_arp != OSPF_PROACTIVE_ARP_DEFAULT) {
+               if (ospf->proactive_arp)
+                       vty_out(vty, " proactive-arp\n");
+               else
+                       vty_out(vty, " no proactive-arp\n");
+       }
+
        FOR_ALL_INTERFACES (vrf, ifp)
                if (OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(ifp),
                                             passive_interface)
@@ -10871,6 +10904,10 @@ void ospf_vty_init(void)
        install_element(OSPF_NODE, &no_ospf_write_multiplier_cmd);
        install_element(OSPF_NODE, &no_write_multiplier_cmd);
 
+       /* "proactive-arp" commands. */
+       install_element(OSPF_NODE, &ospf_proactive_arp_cmd);
+       install_element(OSPF_NODE, &no_ospf_proactive_arp_cmd);
+
        /* Init interface related vty commands. */
        ospf_vty_if_init();
 
index f9cc474d5c4059c39c8293c7feb1cc5b359af132..31d8417eb65ca8ee6d182be35deaa84ca0376ca2 100644 (file)
@@ -305,6 +305,8 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
        new->oi_write_q = list_new();
        new->write_oi_count = OSPF_WRITE_INTERFACE_COUNT_DEFAULT;
 
+       new->proactive_arp = OSPF_PROACTIVE_ARP_DEFAULT;
+
        QOBJ_REG(new, ospf);
 
        new->fd = -1;
index cdeaa38dc0c3ae26ae53c4ed7e170d461c1b9667..230c10e44ff32b0c044542576e2cd21c57750f5d 100644 (file)
@@ -312,6 +312,10 @@ struct ospf {
         * update to neighbors immediatly */
        uint8_t inst_shutdown;
 
+       /* Enable or disable sending proactive ARP requests. */
+       bool proactive_arp;
+#define OSPF_PROACTIVE_ARP_DEFAULT true
+
        /* Redistributed external information. */
        struct list *external[ZEBRA_ROUTE_MAX + 1];
 #define EXTERNAL_INFO(E)      (E->external_info)
index 324b66dd98892c649d0dd76f076f4f454ebc357e..466dd42ce4a2539bb77206a72906c35b365616e0 100644 (file)
@@ -346,6 +346,13 @@ module frr-ospfd {
         "The reference bandwidth in terms of Mbits per second.";
     }
 
+    leaf use-arp {
+      type boolean;
+      default "true";
+      description 
+        "ARP for neighbor table entry.";
+    }
+
     leaf capability-opaque {
       type boolean;
       default "false";