diff options
author | Jon Loeliger <jdl@netgate.com> | 2018-05-17 15:55:00 -0500 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2018-05-18 11:03:03 +0000 |
commit | 1f6e9288536ee30db3911ccea1ea10af4b6b3e5e (patch) | |
tree | 3a14b5b8480c23aaac15ca534914af818518b688 /src | |
parent | 4f2db7d79fafad342ae9dac049ca5c5ee2e0a144 (diff) |
ARP: Ensure STATIC and DYANMIC ARP flags are mutually exclusive.
Change-Id: I44278dea2ee1daa147b0928bfe26e861907a209f
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/ethernet/arp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vnet/ethernet/arp.c b/src/vnet/ethernet/arp.c index 8df96f6a0f1..55beb7025dd 100644 --- a/src/vnet/ethernet/arp.c +++ b/src/vnet/ethernet/arp.c @@ -628,9 +628,15 @@ vnet_arp_set_ip4_over_ethernet_internal (vnet_main_t * vnm, e->time_last_updated = vlib_time_now (vm); if (is_static) - e->flags |= ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC; + { + e->flags &= ~ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC; + e->flags |= ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC; + } else - e->flags |= ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC; + { + e->flags &= ~ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC; + e->flags |= ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC; + } adj_nbr_walk_nh4 (sw_if_index, &e->ip4_address, arp_mk_complete_walk, e); @@ -1819,7 +1825,7 @@ vnet_arp_flush_ip4_over_ethernet_internal (vnet_main_t * vnm, */ if (e->flags & ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC) { - e->flags &= ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC; + e->flags &= ~ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC; } else if (e->flags & ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC) { |