From d3922a5a044a2d14f9a21ba571b125e0417e1274 Mon Sep 17 00:00:00 2001 From: Hal Rosenstock Date: Thu, 1 Aug 2013 14:10:00 -0700 Subject: [PATCH] acm: Save endpoint pkey in host order acm_ep stores and uses a pkey value, assuming that it is in host order. However, ibv_query_pkey returns the pkey in network order. We need to byte swap the pkey when saving it. Signed-off-by: Hal Rosenstock Signed-off-by: Sean Hefty --- src/acm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/acm.c b/src/acm.c index b19582c..0da20f8 100644 --- a/src/acm.c +++ b/src/acm.c @@ -3068,6 +3068,7 @@ static void acm_ep_up(struct acm_port *port, uint16_t pkey_index) if (ret) return; + pkey = ntohs(pkey); /* ibv_query_pkey returns pkey in network order */ if (acm_find_ep(port, pkey)) { acm_log(2, "endpoint for pkey 0x%x already exists\n", pkey); return; -- 2.41.0