From 064bb0d204e331a3f560efe58837b7d1212d2b00 Mon Sep 17 00:00:00 2001 From: Ajay Agarwal Date: Tue, 11 Dec 2018 20:17:11 +0530 Subject: [PATCH] net: qrtr: Handle IPCR control port format of older targets The destination port value in the IPCR control buffer on older targets is 0xFFFF. Handle the same by updating the dst_port to QRTR_PORT_CTRL. Change-Id: Ia70ce1c078ea84f0de47240f6fc3e764f4ae7a6f Signed-off-by: Ajay Agarwal --- net/qrtr/qrtr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 09aaaf5874da..eb4bb24ab2a1 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -36,6 +36,8 @@ #define QRTR_MIN_EPH_SOCKET 0x4000 #define QRTR_MAX_EPH_SOCKET 0x7fff +#define QRTR_PORT_CTRL_LEGACY 0xffff + /* qrtr socket states */ #define QRTR_STATE_MULTI -2 #define QRTR_STATE_INIT -1 @@ -668,6 +670,9 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) goto err; } + if (cb->dst_port == QRTR_PORT_CTRL_LEGACY) + cb->dst_port = QRTR_PORT_CTRL; + if (len != ALIGN(size, 4) + hdrlen) goto err;