aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-01-30 11:41:13 +0100
committerHarald Welte <laforge@osmocom.org>2021-01-30 20:09:35 +0100
commitf0073d7045f1a88846712bb03928be40e1e39c01 (patch)
tree6f5e6b6e8d4296fb6425d492d277ca925c5a7ef4
parent335c550fab46143a20f30f92b8c74d84c5eb0de8 (diff)
ns2: Log ERROR if we cannot transmit a packet due to ENOBUFS
-rw-r--r--src/gb/gprs_ns2_fr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index f73033b4..096e150a 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -247,11 +247,15 @@ static int fr_dlci_rx_cb(void *cb_data, struct msgb *msg)
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;
}