aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-07-12 23:43:21 +0200
committerHarald Welte <laforge@osmocom.org>2020-07-12 23:47:10 +0200
commit1b75abe5ce473eaae3ebef898a72010e7e065fae (patch)
tree1c1eb955c683c845d9b4a1dc6d2c98c5176ad644
parent73f248fd74661ffc2412629a59c7bb85cdb1c496 (diff)
Fix HDLC-FCS transmit side
If we are not able to read more packets from the user application, the recv/read call will return 0 and set errno = EAGAIN. In this situation we cannot bail out but still ask the HDLC code to generate output (sequences of flag octets). If we fail to do that, we will transmit all-ones pattern instaed of all-flag octets. Change-Id: Id3bc76f1956138dcd9cb7b499f7251cd94af1329
-rw-r--r--src/intf_line.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intf_line.c b/src/intf_line.c
index 5994805..4c9c404 100644
--- a/src/intf_line.c
+++ b/src/intf_line.c
@@ -194,7 +194,7 @@ _e1_tx_hdlcfs(struct e1_ts *ts, uint8_t *buf, int len)
rv, osmo_hexdump(ts->tx_buf, rv));
ts->tx_len = rv;
ts->tx_ofs = 0;
- } else if (rv < 0)
+ } else if (rv < 0 && errno != EAGAIN)
return rv;
}