mISDNuser/capi20
Christoph Schulz cf98743fb3 mISDNcapid: ignore incoming B3 data packets until PTY slave sent data
In hijacking mode (CAPIFLAG_HIGHJACKING), a PTY master/slave pair is created to
pass data back and forth between the application and mISDNcapid. However, there
is a small time window between creating the PTY slave and the application
opening the PTY slave. If a B3 data connection is established before the
application has opened the PTY slave, and B3 data is received and written to the
PTY master end, it is immediately read back by the B3 data receiver thread
(BCthread), which then sends the data back to the original sender, causing a
loopback. This e.g. happens when the application is the PPP daemon pppd which
has been configured to not send any data until it receives a valid LCP packet
("silent" option).

In order to fix this, an additional flag called tty_received remembers whether
the B3 data receiver thread has already read data from the PTY at least once.
Only if this is the case B3 data is written to the PTY master end, otherwise it
is discarded as there is no potential receiver at the PTY slave end yet. This
effectively avoids any loopback situations due to an unconnected PTY slave end.

Signed-off-by: Christoph Schulz <develop@kristov.de>
2017-02-27 17:47:59 +01:00
..
module Create the socket directory on runtime 2016-03-29 12:31:22 +02:00
.gitignore Many fixes 2011-11-27 23:03:46 +01:00
Makefile.am Create the socket directory on runtime 2016-03-29 12:31:22 +02:00
SupplementaryService.c mISDN CAPI2.0 additional files 2011-10-21 09:14:45 +02:00
SupplementaryService.h mISDN CAPI2.0 additional files 2011-10-21 09:14:45 +02:00
alaw.c CAPI20 fax support 2011-11-25 16:36:12 +01:00
alaw.h CAPI20 fax support 2011-11-25 16:36:12 +01:00
application.c Fix overwriting ret in action loop, improve debug/error messages. 2014-10-20 14:11:35 +02:00
capi20.conf.sample Add CAPI 2.0 support 2011-10-20 18:34:37 +02:00
capi_obj.c Better refcount locking to avoid use after free 2014-10-14 14:39:44 +02:00
daemon.c mISDNcapid: ignore incoming B3 data packets until PTY slave sent data 2017-02-27 17:47:59 +01:00
faxl3.c Better debugging for descriptor leaks and fixing application release leak 2014-09-22 01:35:42 +02:00
g3_mh.c mISDNcapid version 0.9 2012-01-30 19:05:17 +01:00
g3_mh.h mISDNcapid version 0.9 2012-01-30 19:05:17 +01:00
listen.c Better refcount locking to avoid use after free 2014-10-14 14:39:44 +02:00
lplci.c mISDNcapid: Parse B channel id first from message then its included IEs 2016-04-14 23:41:43 +02:00
m_capi.h mISDNcapid: ignore incoming B3 data packets until PTY slave sent data 2017-02-27 17:47:59 +01:00
m_capi_sock.h.in Create the socket directory on runtime 2016-03-29 12:31:22 +02:00
mc_buffer.c Really use refcounting for the dynamic objects 2012-09-13 14:36:55 +02:00
mc_buffer.h Really use refcounting for the dynamic objects 2012-09-13 14:36:55 +02:00
mplci.c Only the highest matched bit position gives the CIP value 2012-09-17 00:01:49 +02:00
ncci.c mISDNcapid: ignore incoming B3 data packets until PTY slave sent data 2017-02-27 17:47:59 +01:00
ncci.h Really use refcounting for the dynamic objects 2012-09-13 14:36:55 +02:00
sff.c Fix wrong format 2012-05-22 22:29:32 +02:00
sff.h Many fixes 2011-11-27 23:03:46 +01:00