From: Florin Coras Date: Thu, 15 Jun 2017 22:07:32 +0000 (-0700) Subject: Fix vni/dp_table endianness for gpe iface addition (VPP-882) X-Git-Tag: v17.07-rc1~38 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F68%2F7168%2F4;hp=b5c29f9c2218e6242d5f126bc490abf27fd39f4c;p=vpp.git Fix vni/dp_table endianness for gpe iface addition (VPP-882) Change-Id: I2b78dad740b67fc05b0e2cf9c180809bc0962cd5 Signed-off-by: Florin Coras --- diff --git a/src/vat/api_format.c b/src/vat/api_format.c index d31b301e0ed..0a38353c07a 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -15950,9 +15950,9 @@ api_lisp_gpe_add_del_iface (vat_main_t * vam) M (GPE_ADD_DEL_IFACE, mp); mp->is_add = is_add; - mp->dp_table = dp_table; + mp->dp_table = clib_host_to_net_u32 (dp_table); mp->is_l2 = is_l2; - mp->vni = vni; + mp->vni = clib_host_to_net_u32 (vni); /* send it... */ S (mp); diff --git a/src/vnet/lisp-gpe/lisp_gpe_api.c b/src/vnet/lisp-gpe/lisp_gpe_api.c index 364bee0c439..f1663699ae6 100644 --- a/src/vnet/lisp-gpe/lisp_gpe_api.c +++ b/src/vnet/lisp-gpe/lisp_gpe_api.c @@ -386,28 +386,30 @@ vl_api_gpe_add_del_iface_t_handler (vl_api_gpe_add_del_iface_t * mp) { vl_api_gpe_add_del_iface_reply_t *rmp; int rv = 0; + u32 vni, dp_table; + + vni = clib_net_to_host_u32 (mp->vni); + dp_table = clib_net_to_host_u32 (mp->dp_table); if (mp->is_l2) { if (mp->is_add) { - if (~0 == - lisp_gpe_tenant_l2_iface_add_or_lock (mp->vni, mp->dp_table)) + if (~0 == lisp_gpe_tenant_l2_iface_add_or_lock (vni, dp_table)) rv = 1; } else - lisp_gpe_tenant_l2_iface_unlock (mp->vni); + lisp_gpe_tenant_l2_iface_unlock (vni); } else { if (mp->is_add) { - if (~0 == - lisp_gpe_tenant_l3_iface_add_or_lock (mp->vni, mp->dp_table)) + if (~0 == lisp_gpe_tenant_l3_iface_add_or_lock (vni, dp_table)) rv = 1; } else - lisp_gpe_tenant_l3_iface_unlock (mp->vni); + lisp_gpe_tenant_l3_iface_unlock (vni); } REPLY_MACRO (VL_API_GPE_ADD_DEL_IFACE_REPLY);