summaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/commands.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-03-20 16:06:12 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-04-11 16:28:56 +0200
commit5eef6669759f8e291ab0347894876b532c242324 (patch)
tree54939e3efa7511cfcde7300dee9e1adb5c122525 /net/nfc/llcp/commands.c
parente279f84f304d5486291a2d6465105dc6f96cc8ca (diff)
NFC: llcp: Socket miux is a big endian field
The MIUX must be transmitted in big endian and as such we have to convert it properly. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/llcp/commands.c')
-rw-r--r--net/nfc/llcp/commands.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp/commands.c
index b75a9b3f9e8..c5535cc9ed3 100644
--- a/net/nfc/llcp/commands.c
+++ b/net/nfc/llcp/commands.c
@@ -420,7 +420,8 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock)
}
/* If the socket parameters are not set, use the local ones */
- miux = sock->miux > LLCP_MAX_MIUX ? local->miux : sock->miux;
+ miux = be16_to_cpu(sock->miux) > LLCP_MAX_MIUX ?
+ local->miux : sock->miux;
rw = sock->rw > LLCP_MAX_RW ? local->rw : sock->rw;
miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&miux, 0,
@@ -475,7 +476,8 @@ int nfc_llcp_send_cc(struct nfc_llcp_sock *sock)
return -ENODEV;
/* If the socket parameters are not set, use the local ones */
- miux = sock->miux > LLCP_MAX_MIUX ? local->miux : sock->miux;
+ miux = be16_to_cpu(sock->miux) > LLCP_MAX_MIUX ?
+ local->miux : sock->miux;
rw = sock->rw > LLCP_MAX_RW ? local->rw : sock->rw;
miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&miux, 0,