falconia submitted this change.

View Change


Approvals: laforge: Looks good to me, but someone else must approve tnt: Looks good to me, approved Jenkins Builder: Verified
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(-)

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;


To view, visit change 37321. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I42849a6d19b020bab789853c3b60af6a1c09f92f
Gerrit-Change-Number: 37321
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon@freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon@freecalypso.org>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: tnt <tnt@246tNt.com>
Gerrit-MessageType: merged