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@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9566 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2011-01-03 18:25:00 +00:00
parent 08eb1a560d
commit 56a6e402ae

View File

@ -82,10 +82,17 @@ dahdi_dynamic_local_transmit(void *pvt, unsigned char *msg, int msglen)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&local_lock, flags); spin_lock_irqsave(&local_lock, flags);
if (d->peer && d->peer->span) if (d->peer && d->peer->span) {
dahdi_dynamic_receive(d->peer->span, msg, msglen); if (test_bit(DAHDI_FLAGBIT_REGISTERED, &d->peer->span->flags))
if (d->monitor_rx_peer && d->monitor_rx_peer->span) dahdi_dynamic_receive(d->peer->span, msg, msglen);
dahdi_dynamic_receive(d->monitor_rx_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); spin_unlock_irqrestore(&local_lock, flags);
return 0; return 0;
} }