[svn-commits] sruffell: linux/trunk r9566 - /linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jan 3 18:25:04 UTC 2011


Author: sruffell
Date: Mon Jan  3 12:25:00 2011
New Revision: 9566

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9566
Log:
dahdi_dynamic_loc: Do not call dahdi_dynamic_receive on peers before reg.

It's possible for dahdi_dynamic_loc spans to be "peered" before the
dahdi_span is fully register.  Do not call dahdi_dynamic_receive on any
peers before they are fully registered.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c

Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c?view=diff&rev=9566&r1=9565&r2=9566
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c Mon Jan  3 12:25:00 2011
@@ -82,10 +82,17 @@
 	unsigned long flags;
 
 	spin_lock_irqsave(&local_lock, flags);
-	if (d->peer && d->peer->span)
-		dahdi_dynamic_receive(d->peer->span, msg, msglen);
-	if (d->monitor_rx_peer && d->monitor_rx_peer->span)
-		dahdi_dynamic_receive(d->monitor_rx_peer->span, msg, msglen);
+	if (d->peer && d->peer->span) {
+		if (test_bit(DAHDI_FLAGBIT_REGISTERED, &d->peer->span->flags))
+			dahdi_dynamic_receive(d->peer->span, msg, msglen);
+	}
+	if (d->monitor_rx_peer && d->monitor_rx_peer->span) {
+		if (test_bit(DAHDI_FLAGBIT_REGISTERED,
+			     &d->monitor_rx_peer->span->flags))  {
+			dahdi_dynamic_receive(d->monitor_rx_peer->span,
+					      msg, msglen);
+		}
+	}
 	spin_unlock_irqrestore(&local_lock, flags);
 	return 0;
 }




More information about the svn-commits mailing list