Hi Jon,

I am in the process of fixing up something in handling of IP neighbor pools.  I 
can include fixing the S/D bits of ARP flag in my patch, if you are not in a 
hurry to have this fixed.

Regards,
John

From: Jon Loeliger <j...@netgate.com>
Sent: Friday, May 11, 2018 12:09 PM
To: John Lo (loj) <l...@cisco.com>
Cc: vpp-dev <vpp-dev@lists.fd.io>
Subject: Re: [vpp-dev] Static ARP Flag Question

On Thu, May 10, 2018 at 7:28 PM, John Lo (loj) 
<l...@cisco.com<mailto:l...@cisco.com>> wrote:
Hi Jon,

Hi John,

This is not the right behavior.

I had that suspicion... :-)

  I think it is caused by reuse of a static ARP entry in  the IP4 neighbor pool 
with static bit still set.  The code merely set the dynamic bit in the flags 
but left the static bit untouched (similarly for the static path) in arp.c 
function vnet_arp_set_ip4_over_ethernet_internal ():

  e->time_last_updated = vlib_time_now (vm);
  if (is_static)
    e->flags |= ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC;
  else
    e->flags |= ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC;

Ah, right.  So it should always be one or the other, and never both.  Right?

I spotted another error in the function 
vnet_arp_flush_ip4_over_ethernet_internal()

     if (e->flags & ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC)
        {
          e->flags &= ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC;
        }
      else if (e->flags & ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC)
        {
          arp_entry_free (eai, e);
        }

I believe the “if static” path should be:
          e->flags &= ~ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC;

Would you like to submit a patch to fix them?

Sure!  I will make a first-effort and submit a patch!

jdl

Reply via email to