diff options
author | Harald Welte <laforge@osmocom.org> | 2021-01-30 11:41:13 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-01-30 20:09:35 +0100 |
commit | f0073d7045f1a88846712bb03928be40e1e39c01 (patch) | |
tree | 6f5e6b6e8d4296fb6425d492d277ca925c5a7ef4 | |
parent | 335c550fab46143a20f30f92b8c74d84c5eb0de8 (diff) |
ns2: Log ERROR if we cannot transmit a packet due to ENOBUFS
Related: OS#4995
Change-Id: I2ba64e96c60e23d2e6c8ecdcab0b52b3833f092c
-rw-r--r-- | src/gb/gprs_ns2_fr.c | 10 |
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; } |