if ($r) {
my $ar;
if ($call ne $parent->call) {
- $ar = $parent->add($r);
- push @rout, $ar if $ar;
+ if ($self->in_filter_route($r)) {
+ $ar = $parent->add($r);
+ push @rout, $ar if $ar;
+ }
}
if ($r->version ne $ver || $r->flags != $flags) {
$r->version($ver);
} else {
next if $call eq $main::mycall || $call eq $self->{call};
- my $new = $parent->new($call, $ver, Route::here($here)|Route::conf($conf));
+ my $new = Route->new($call); # throw away
if ($self->in_filter_route($new)) {
- $parent->add($new);
- push @rout, $new;
- } else {
- $new->del($parent);
+ my $r = $parent->add($call, $ver, $flags);
+ push @rout, $r;
}
}
foreach $dxchan (@dxchan) {
next if $dxchan == $self;
next if $dxchan == $me;
- if ($self->{routefilter} || !$self->{isolate}) {
+ if ($dxchan->{routefilter} || !$self->{isolate}) {
$dxchan->send_route($generate, @_)
} else {
dbg('DXPROT: isolated') if isdbg('chanerr');
sub add
{
my $parent = shift;
- my $call = shift;
- my $self;
-
- if (ref $call) {
- $self = $call;
- $call = $self->{call};
- } else {
- $self = get($call);
- }
-
- confess "Trying to add NULL Node call to routing tables" unless $call;
-
+ my $call = uc shift;
+ confess "Route::add trying to add $call to myself" if $call eq $parent->{call};
+ my $self = get($call);
if ($self) {
$self->_addparent($parent->{call});
$parent->_addnode($call);
return undef;
}
- confess "Route::Node::add trying to add $call to myself" if $call eq $parent->{call};
$parent->_addnode($call);
$self = $parent->new($call, @_);
return $self;