Change in libosmocore[master]: ns2: Log ERROR if we cannot transmit a packet due to ENOBUFS

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Feb 1 08:32:11 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22552 )

Change subject: ns2: Log ERROR if we cannot transmit a packet due to ENOBUFS
......................................................................

ns2: Log ERROR if we cannot transmit a packet due to ENOBUFS

Related: OS#4995
Change-Id: I2ba64e96c60e23d2e6c8ecdcab0b52b3833f092c
---
M src/gb/gprs_ns2_fr.c
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  lynxis lazus: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index f73033b..096e150 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -247,11 +247,15 @@
 
 static int handle_netif_write(struct osmo_fd *ofd, struct msgb *msg)
 {
-	int rc = write(ofd->fd, msgb_data(msg), msgb_length(msg));
+	struct gprs_ns2_vc_bind *bind = ofd->data;
+	int rc;
+
+	rc = write(ofd->fd, msgb_data(msg), msgb_length(msg));
 	/* write_queue expects a "-errno" type return value in case of failure */
-	if (rc == -1)
+	if (rc == -1) {
+		LOGBIND(bind, LOGL_ERROR, "error during write to AF_PACKET: %s\n", strerror(errno));
 		return -errno;
-	else
+	} else
 		return rc;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22552
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2ba64e96c60e23d2e6c8ecdcab0b52b3833f092c
Gerrit-Change-Number: 22552
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210201/b73d4794/attachment.htm>


More information about the gerrit-log mailing list