push non-pc9x nodes to the back for routing
authorDirk Koopman <djk@tobit.co.uk>
Wed, 10 Oct 2007 10:37:24 +0000 (11:37 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Wed, 10 Oct 2007 10:37:24 +0000 (11:37 +0100)
Currently, if a directly connected non-pc9x node advertises a route
to another node, even if that node

perl/DXProtHandle.pm
perl/DXProtout.pm
perl/Route.pm
perl/Version.pm

index cd4cdd44cba2f915374fe220b6ba400803b48ccd..eea43772deb4f06eb0826c779abbf98959257259 100644 (file)
@@ -1559,7 +1559,7 @@ sub pc92_handle_first_slot
        }
        $parent->here(Route::here($here));
        $parent->version($version || $pc19_version) if $version;
-       $parent->build($build) if $build && $build > $parent->build;
+       $parent->build($build) if $build;
        $parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call;
        return ($parent, @radd);
 }
@@ -1674,16 +1674,9 @@ sub handle_92
                # this is the main route section
                # here is where all the routes are created and destroyed
 
-               # cope with missing duplicate node calls in the first slot for A or D
+               # cope with missing duplicate node calls in the first slot
                my $me = $_[4] || '';
-               if (($sort eq 'A' || $sort eq 'D')) {
-                       $me ||= _encode_pc92_call($parent) unless $me ;
-               } else {
-                       unless ($me) {
-                               dbg("PCPROT: this type of PC92 *must* have a node call in the first slot, ignored") if is_dbg('chanerr');
-                               return;
-                       }
-               }
+               $me ||= _encode_pc92_call($parent) unless $me ;
 
                my @ent = map {my @a = _decode_pc92_call($_); @a ? \@a : ()} grep {$_ && /^[0-7]/} $me, @_[5 .. $#_];
 
index 03676089dc33acd5b5072cd973f0babb32258398..8c5e56d9abe3cdf5da625734b33670350bbc189b 100644 (file)
@@ -422,7 +422,7 @@ sub pc92d
 # send a config
 sub pc92c
 {
-       return _gen_pc92('C', 1, @_);
+       return _gen_pc92('C', 0, @_);
 }
 
 # send a keep alive
index 290cd7628f10823e61611398bf48a8b95de9ba2c..0f23d45531c1e40ba6aa9640931b232e01a338eb 100644 (file)
@@ -296,6 +296,8 @@ sub findroutes
 
        # recursion detector
        return () if $seen->{$call};
+
+       # return immediately if we are directly connected
        if (my $dxchan = DXChannel::get($call)) {
                $seen->{$call}++;
                push @out, $level ? [$level, $dxchan] : $dxchan;
@@ -308,8 +310,11 @@ sub findroutes
        return () unless $nref;
        foreach my $ncall (@{$nref->{parent}}) {
                unless ($seen->{$ncall}) {
-                       dbg("recursing from $call -> $ncall") if isdbg('routec');
-                       my @rout = findroutes($ncall, $level+1, $seen);
+
+                       # put non-pc9x nodes to the back of the queue
+                       my $l = $level + ($nref->{do_pc9x} ? 0 : 30);
+                       dbg("recursing from $call -> $ncall level $l") if isdbg('routec');
+                       my @rout = findroutes($ncall, $l+1, $seen);
                        push @out, @rout;
                }
        }
index 4cf30ad0169f9520fac99638a34f678159624cc7..71aff4a098d1197381d2f49bc67e797cf40de885 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '167';
+$build = '168';
 
 1;