[XS] Change in osmo-pcap[master]: server: Limit rx buffer size to UINT16_MAX
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39340?usp=email ) Change subject: server: Limit rx buffer size to UINT16_MAX ...................................................................... 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(-) Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve 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 https://gerrit.osmocom.org/c/osmo-pcap/+/39340?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I96bfe1625510cca67f5781e2895caf2a3612ec62 Gerrit-Change-Number: 39340 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de>
participants (1)
-
pespin