pespin has uploaded this change for review.

View Change

server: Limit rx buffer size to UINT16_MAX

We can't receive bigger buffers anyway as limited by protocol and msgb
itself, so trim it.

Change-Id: I96bfe1625510cca67f5781e2895caf2a3612ec62
---
M src/osmo_server_core.c
1 file changed, 3 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/40/39340/1
diff --git a/src/osmo_server_core.c b/src/osmo_server_core.c
index f6c42ce..14a1410 100644
--- a/src/osmo_server_core.c
+++ b/src/osmo_server_core.c
@@ -149,6 +149,9 @@
pcapng_max_len_opt +
sizeof(uint32_t);
data_max_len = OSMO_MAX(data_max_len, pcapng_epb_max_len + server->max_snaplen);
+
+ /* We are limited by (struct osmo_pcap_data)->len and msgb->len being uint16: */
+ data_max_len = OSMO_MIN(data_max_len, UINT16_MAX);
return data_max_len;
}


To view, visit change 39340. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I96bfe1625510cca67f5781e2895caf2a3612ec62
Gerrit-Change-Number: 39340
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>