summaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/sock.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/sock.c
parente279f84f304d5486291a2d6465105dc6f96cc8ca (diff)
downloadop-kernel-dev-5eef6669759f8e291ab0347894876b532c242324.zip
op-kernel-dev-5eef6669759f8e291ab0347894876b532c242324.tar.gz
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/sock.c')
-rw-r--r--net/nfc/llcp/sock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c
index 6fa7670..873c837 100644
--- a/net/nfc/llcp/sock.c
+++ b/net/nfc/llcp/sock.c
@@ -279,7 +279,7 @@ static int nfc_llcp_setsockopt(struct socket *sock, int level, int optname,
break;
}
- llcp_sock->miux = (u16) opt;
+ llcp_sock->miux = cpu_to_be16((u16) opt);
break;
@@ -323,7 +323,8 @@ static int nfc_llcp_getsockopt(struct socket *sock, int level, int optname,
break;
case NFC_LLCP_MIUX:
- if (put_user(llcp_sock->miux, (u32 __user *) optval))
+ if (put_user(be16_to_cpu(llcp_sock->miux),
+ (u32 __user *) optval))
err = -EFAULT;
break;
@@ -921,7 +922,7 @@ struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp)
llcp_sock->ssap = 0;
llcp_sock->dsap = LLCP_SAP_SDP;
llcp_sock->rw = LLCP_MAX_RW + 1;
- llcp_sock->miux = LLCP_MAX_MIUX + 1;
+ llcp_sock->miux = cpu_to_be16(LLCP_MAX_MIUX + 1);
llcp_sock->remote_rw = LLCP_DEFAULT_RW;
llcp_sock->remote_miu = LLCP_DEFAULT_MIU;
llcp_sock->send_n = llcp_sock->send_ack_n = 0;
OpenPOWER on IntegriCloud