X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=8f46826a60c9ee93498320e2cb1e31a9769255ab;hb=5a06cd7853e8bff86a0f17854c0791bb3f85c395;hp=e1d4fb28647bc854325538a418033766bb32cc37;hpb=d2166e1f70cd2fae131c906c67f1a322472fb5a4;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index e1d4fb28..8f46826a 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1005,6 +1005,8 @@ sub handle_19 # new routing list my @rout; + + # first get the INTERFACE node my $parent = Route::Node::get($self->{call}); unless ($parent) { dbg("DXPROT: my parent $self->{call} has disappeared"); @@ -1012,6 +1014,27 @@ sub handle_19 return; } + # if the origin isn't the same as the INTERFACE, then reparent, creating nodes as necessary + if ($origin ne $self->call) { + my $op = Route::Node::get($origin); + unless ($op) { + $op = $parent->add($origin, 5000, Route::here(1)); + my $user = DXUser->get_current($origin); + if (!$user) { + $user = DXUser->new($origin); + $user->sort('S'); + $user->priv(1); # I have relented and defaulted nodes + $user->lockout(1); + $user->homenode($origin); + $user->node($origin); + $user->wantroutepc19(1); + $user->wantpc90(1); + } + $user->put; + } + $parent = $op; + } + # parse the PC19 for ($i = 1; $i < $#_-1; $i += 4) { my $here = $_[$i]; @@ -1349,7 +1372,13 @@ sub handle_37 my $pcno = shift; my $line = shift; my $origin = shift; - DXDb::process($self, $line); + if ($_[1] eq $main::mycall) { + no strict 'refs'; + my $sub = "DXDb::handle_$pcno"; + &$sub($self, @_); + } else { + $self->route($_[1], $line) unless $self->is_clx; + } } # node connected list from neighbour