aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2020-12-04 10:16:24 +0100
committerLoic Poulain <loic.poulain@linaro.org>2020-12-04 10:16:24 +0100
commitca78102f5427835aa72dbfeb3016c672c7024382 (patch)
treeb96b5f5e63787c2a22acaaf25e7aa107f8d60679
parent3bbec48b2878cb39e2ec6101a65b331f03eb97b7 (diff)
Fix MTU size for virtual rmnet iface
Take into account the QMAP/RMNET header size. Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
-rwxr-xr-xmhi-qmi-connectbin100568 -> 100568 bytes
-rw-r--r--mhi-qmi-connect.c3
2 files changed, 2 insertions, 1 deletions
diff --git a/mhi-qmi-connect b/mhi-qmi-connect
index ea378f9..14f99a2 100755
--- a/mhi-qmi-connect
+++ b/mhi-qmi-connect
Binary files differ
diff --git a/mhi-qmi-connect.c b/mhi-qmi-connect.c
index 537af8f..838fe6e 100644
--- a/mhi-qmi-connect.c
+++ b/mhi-qmi-connect.c
@@ -11,6 +11,7 @@
#define MAX_QMAP_DATAGRAM_SIZE 16384
#define MAX_QMAP_AGGREGATED_DATAGRAM 16
+#define QMAP_HEADER_SIZE 16
// IFACE_ID/ENDPOINT_TYPE allows to select the type of endpoint/bus
// to use (pcie, embedded, usb) by the modem, and IFACE_ID selects
@@ -341,7 +342,7 @@ static void setup_rmnet(void)
/* Set RMNET MTU */
g_snprintf(cmdline, sizeof(cmdline), "%s link set rmnet_data%u mtu %u",
- iptool, config.mux_id, MAX_QMAP_DATAGRAM_SIZE);
+ iptool, config.mux_id, MAX_QMAP_DATAGRAM_SIZE - QMAP_HEADER_SIZE);
if (!g_spawn_command_line_sync(cmdline, NULL, NULL, NULL, &error)) {
g_printerr("%s: %s\n", cmdline, error->message);
g_error_free(error);