From 494472ee1ab717a143e6d649419d0fd367f041eb Mon Sep 17 00:00:00 2001 From: Russ Meyerriecks Date: Fri, 19 Nov 2010 17:34:36 +0000 Subject: [PATCH] dahdi: Stops junk data from overwriting the dahdi_mirror pseudo chans (issue #16831) Reported by: tsearle Patches: dahdi_mirror2.patch uploaded by tsearle (license 373) Signed-off-by: Russ Meyerriecks Acked-by: Shaun Ruffell git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9493 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 12 ++++++++++-- include/dahdi/dahdi_config.h | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 2c0b4d7..368b049 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -8528,8 +8528,16 @@ static void process_masterspan(void) list_for_each_entry(pseudo, &pseudo_chans, node) { unsigned char tmp[DAHDI_CHUNKSIZE]; spin_lock(&pseudo->chan.lock); - __dahdi_getempty(&pseudo->chan, tmp); - __dahdi_receive_chunk(&pseudo->chan, tmp); +#ifdef CONFIG_DAHDI_MIRROR + // if this is a mirroring don't generate garbage + if(!pseudo->chan.srcmirror) + { +#endif /* CONFIG_DAHDI_MIRROR */ + __dahdi_getempty(&pseudo->chan, tmp); + __dahdi_receive_chunk(&pseudo->chan, tmp); +#ifdef CONFIG_DAHDI_MIRROR + } +#endif /* CONFIG_DAHDI_MIRROR */ spin_unlock(&pseudo->chan.lock); } diff --git a/include/dahdi/dahdi_config.h b/include/dahdi/dahdi_config.h index 032a9d7..59896af 100644 --- a/include/dahdi/dahdi_config.h +++ b/include/dahdi/dahdi_config.h @@ -187,6 +187,6 @@ /* * Creates an interface for mirroring the raw channel data out to a pseudo-chan */ -/*#define CONFIG_DAHDI_MIRROR*/ +/* #define CONFIG_DAHDI_MIRROR */ #endif