summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2020-04-01 15:42:06 +0200
committerOle Trøan <otroan@employees.org>2020-04-03 11:26:28 +0000
commit4fce36b8f9922d979ad72d89fb891bff0c4483ad (patch)
treeb5da648c00ce3014ce728445a889966a4063c629 /src
parentb32436aab9626cb8b7bc4099142135c5c9e19beb (diff)
ip: remove vl_api_address_family_t byte order swap
Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I8074db3623ee4b37ac70ce8ea0d1912b97e5c059
Diffstat (limited to 'src')
-rw-r--r--src/plugins/vrrp/vrrp_api.c8
-rw-r--r--src/vpp/api/types.c12
2 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/vrrp/vrrp_api.c b/src/plugins/vrrp/vrrp_api.c
index 9ef90203f32..500569ef1b8 100644
--- a/src/plugins/vrrp/vrrp_api.c
+++ b/src/plugins/vrrp/vrrp_api.c
@@ -186,14 +186,14 @@ send_vrrp_vr_details (vrrp_vr_t * vr, vl_api_registration_t * reg,
if (vrrp_vr_is_ipv6 (vr))
{
- api_addr->af = htonl (ADDRESS_IP6);
+ api_addr->af = ADDRESS_IP6;
dst = &api_addr->un.ip6;
src = &addr->ip6;
len = sizeof (addr->ip6);
}
else
{
- api_addr->af = htonl (ADDRESS_IP4);
+ api_addr->af = ADDRESS_IP4;
dst = &api_addr->un.ip4;
src = &addr->ip4;
len = sizeof (addr->ip4);
@@ -317,14 +317,14 @@ send_vrrp_vr_peer_details (vrrp_vr_t * vr, vl_api_registration_t * reg,
if (vrrp_vr_is_ipv6 (vr))
{
- api_addr->af = htonl (ADDRESS_IP6);
+ api_addr->af = ADDRESS_IP6;
dst = &api_addr->un.ip6;
src = &addr->ip6;
len = sizeof (addr->ip6);
}
else
{
- api_addr->af = htonl (ADDRESS_IP4);
+ api_addr->af = ADDRESS_IP4;
dst = &api_addr->un.ip4;
src = &addr->ip4;
len = sizeof (addr->ip4);
diff --git a/src/vpp/api/types.c b/src/vpp/api/types.c
index 92905c260d2..a30736fbb9f 100644
--- a/src/vpp/api/types.c
+++ b/src/vpp/api/types.c
@@ -27,7 +27,7 @@ format_vl_api_address_family (u8 * s, va_list * args)
{
vl_api_address_family_t af = va_arg (*args, int);
- if (ADDRESS_IP6 == clib_net_to_host_u32 (af))
+ if (ADDRESS_IP6 == af)
s = format (s, "ip4");
else
s = format (s, "ip6");
@@ -40,7 +40,7 @@ format_vl_api_address (u8 * s, va_list * args)
{
const vl_api_address_t *addr = va_arg (*args, vl_api_address_t *);
- if (ADDRESS_IP6 == clib_net_to_host_u32 (addr->af))
+ if (ADDRESS_IP6 == addr->af)
s = format (s, "%U", format_ip6_address, addr->un.ip6);
else
s = format (s, "%U", format_ip4_address, addr->un.ip4);
@@ -130,9 +130,9 @@ unformat_vl_api_address (unformat_input_t * input, va_list * args)
vl_api_address_t *ip = va_arg (*args, vl_api_address_t *);
if (unformat (input, "%U", unformat_ip4_address, &ip->un.ip4))
- ip->af = clib_host_to_net_u32(ADDRESS_IP4);
+ ip->af = ADDRESS_IP4;
else if (unformat (input, "%U", unformat_ip6_address, &ip->un.ip6))
- ip->af = clib_host_to_net_u32(ADDRESS_IP6);
+ ip->af = ADDRESS_IP6;
else
return (0);
@@ -146,9 +146,9 @@ unformat_vl_api_address_family (unformat_input_t * input,
vl_api_address_family_t *af = va_arg (*args, vl_api_address_family_t *);
if (unformat (input, "ip4") || unformat (input, "ipv4"))
- *af = clib_host_to_net_u32(ADDRESS_IP4);
+ *af = ADDRESS_IP4;
else if (unformat (input, "ip6") || unformat (input, "ipv6"))
- *af = clib_host_to_net_u32(ADDRESS_IP6);
+ *af = ADDRESS_IP6;
else
return (0);