aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/api/api.c
diff options
context:
space:
mode:
authorWojciech Dec <wdec@cisco.com>2017-03-07 19:30:39 +0100
committerJohn Lo <loj@cisco.com>2017-03-07 20:50:03 +0000
commit09a38a6db4235dcacbfb6d5e3686faaeb1c25a37 (patch)
tree79a2f134b6c6d990045d761e698f7aba8cc8a964 /src/vpp/api/api.c
parent3212c57087069c5137abe4919ac1336e79fa93e9 (diff)
Fix endian issue in ARP Event Reply
ARP Event reply sw_if_index was getting passed in host byte order. Change-Id: Ifae8673906ac2c4233f146786a3d02c38280809b Signed-off-by: Wojciech Dec <wdec@cisco.com>
Diffstat (limited to 'src/vpp/api/api.c')
-rw-r--r--src/vpp/api/api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vpp/api/api.c b/src/vpp/api/api.c
index f06894e8783..828394edc59 100644
--- a/src/vpp/api/api.c
+++ b/src/vpp/api/api.c
@@ -1493,7 +1493,7 @@ arp_change_data_callback (u32 pool_index, u8 * new_mac,
}
else
{ /* same mac */
- if (sw_if_index == event->sw_if_index &&
+ if (sw_if_index == ntohl(event->sw_if_index) &&
(!event->mac_ip ||
/* for BD case, also check IP address with 10 sec timeout */
(address == event->address &&
@@ -1503,7 +1503,7 @@ arp_change_data_callback (u32 pool_index, u8 * new_mac,
/* *INDENT-ON* */
arp_event_last_time = now;
- event->sw_if_index = sw_if_index;
+ event->sw_if_index = htonl (sw_if_index);
if (event->mac_ip)
event->address = address;
return 0;
@@ -1531,7 +1531,7 @@ nd_change_data_callback (u32 pool_index, u8 * new_mac,
}
else
{ /* same mac */
- if (sw_if_index == event->sw_if_index &&
+ if (sw_if_index == ntohl(event->sw_if_index) &&
(!event->mac_ip ||
/* for BD case, also check IP address with 10 sec timeout */
(ip6_address_is_equal (address,
@@ -1542,7 +1542,7 @@ nd_change_data_callback (u32 pool_index, u8 * new_mac,
/* *INDENT-ON* */
nd_event_last_time = now;
- event->sw_if_index = sw_if_index;
+ event->sw_if_index = htonl (sw_if_index);
if (event->mac_ip)
clib_memcpy (event->address, address, sizeof (event->address));
return 0;