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 <ajaya@codeaurora.org>
tirimbino
Ajay Agarwal 6 years ago
parent d65b144fc4
commit 064bb0d204
  1. 5
      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;

Loading…
Cancel
Save