falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/37321?usp=email )
Change subject: mux from not-started raw TS: fill with 0xFF ......................................................................
mux from not-started raw TS: fill with 0xFF
When the channelized mux reads from a raw TS, but that raw TS is not in tx_started state yet, the read function returns "fake" data. However, it was actually returning uninitialized memory content, rather than 0xFF filler used everywhere else, thereby transmitting uninit-memory garbage to whatever is connected to the E1 line. Change it to fill with 0xFF, same as the filler used in other cases such as inactive timeslots.
Change-Id: I42849a6d19b020bab789853c3b60af6a1c09f92f --- M src/mux_demux.c 1 file changed, 20 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/21/37321/1
diff --git a/src/mux_demux.c b/src/mux_demux.c index a0ae717..72379fe 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -55,8 +55,10 @@
/* If we're not started yet, we 'fake' data until the other side * send something */ - if (l < 0 && errno == EAGAIN && !ts->raw.tx_started) + if (l < 0 && errno == EAGAIN && !ts->raw.tx_started) { + memset(buf, 0xFF, len); return len; + }
ts->raw.tx_started = true;