[XS] Change in libosmocore[master]: gsmtap_util: Set source_fd RCVBUF to minimum
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41715?usp=email ) Change subject: gsmtap_util: Set source_fd RCVBUF to minimum ...................................................................... gsmtap_util: Set source_fd RCVBUF to minimum We never expect to receive anything on this socket, so set its RCVBUF to the minimum possible to save some memory. Change-Id: If82b3edf11dea1a124035d4eb0e6aa44f4223555 --- M src/core/gsmtap_util.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c index 3fab7ac..0a920e3 100644 --- a/src/core/gsmtap_util.c +++ b/src/core/gsmtap_util.c @@ -501,6 +501,7 @@ { struct gsmtap_inst *gti; int fd; + int buflen; fd = gsmtap_source_init_fd2(local_host, local_port, rem_host, rem_port); if (fd < 0) @@ -522,6 +523,11 @@ osmo_iofd_set_txqueue_max_length(gti->out, 1024); } + /* We never read from this socket, so tell the kernel + * to set the RCVBUF to the minimum possible value */ + buflen = 0; + setsockopt(gti->source_fd, SOL_SOCKET, SO_RCVBUF, &buflen, sizeof(buflen)); + return gti; err_cleanup: -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41715?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: If82b3edf11dea1a124035d4eb0e6aa44f4223555 Gerrit-Change-Number: 41715 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: pespin <pespin@sysmocom.de>
participants (1)
-
pespin