summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_forward.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-08-10 05:30:06 -0700
committerDamjan Marion <dmarion@me.com>2019-01-30 19:47:53 +0000
commit37029305c671f4e2d091d6f6c22142634e409043 (patch)
treef47257c77b860213fcd1901686874dee43ad1f73 /src/vnet/ip/ip4_forward.c
parent13b2ba2ad5527c8185dce368993a3877e7daf7a2 (diff)
Use IP and MAC API types for neighbors
use address_t and mac_address_t for IPv6 and ARP entries and all other API calls in ip.api aprat from the route ones, that will follow in a separate commit Change-Id: I67161737c2184d3f8fc1e79ebd2b55121c5b0191 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_forward.c')
-rw-r--r--src/vnet/ip/ip4_forward.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index 1a1b7e5182b..5fc2552f5ca 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -948,10 +948,6 @@ ip4_lookup_init (vlib_main_t * vm)
clib_memset (&h, 0, sizeof (h));
- /* Set target ethernet address to all zeros. */
- clib_memset (h.ip4_over_ethernet[1].ethernet, 0,
- sizeof (h.ip4_over_ethernet[1].ethernet));
-
#define _16(f,v) h.f = clib_host_to_net_u16 (v);
#define _8(f,v) h.f = v;
_16 (l2_type, ETHERNET_ARP_HARDWARE_TYPE_ethernet);
@@ -1872,9 +1868,8 @@ ip4_arp_inline (vlib_main_t * vm,
hw_if0 = vnet_get_sup_hw_interface (vnm, sw_if_index0);
/* Src ethernet address in ARP header. */
- clib_memcpy_fast (h0->ip4_over_ethernet[0].ethernet,
- hw_if0->hw_address,
- sizeof (h0->ip4_over_ethernet[0].ethernet));
+ mac_address_from_bytes (&h0->ip4_over_ethernet[0].mac,
+ hw_if0->hw_address);
if (is_glean)
{
/* The interface's source address is stashed in the Glean Adj */
@@ -2046,8 +2041,7 @@ ip4_probe_neighbor (vlib_main_t * vm, ip4_address_t * dst, u32 sw_if_index,
sw_if_index);
}
- clib_memcpy_fast (h->ip4_over_ethernet[0].ethernet, hi->hw_address,
- sizeof (h->ip4_over_ethernet[0].ethernet));
+ mac_address_from_bytes (&h->ip4_over_ethernet[0].mac, hi->hw_address);
h->ip4_over_ethernet[0].ip4 = src[0];
h->ip4_over_ethernet[1].ip4 = dst[0];