fix route promoted PC11s so that the PC61 are sent!
authorDirk Koopman <djk@tobit.co.uk>
Sat, 14 Jan 2023 19:29:13 +0000 (19:29 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 14 Jan 2023 19:29:13 +0000 (19:29 +0000)
Changes
perl/DXProtHandle.pm

diff --git a/Changes b/Changes
index 902e0707945038598d52ed1dd33f586df80ea4dd..9c6ffd41ca26325e1cb55856e92abb992eb37a3d 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+14Jan23=======================================================================
+1. Fixed route PC11 promotions so that a new PC61 is actually generated and 
+   also sent instead of the original PC11 (to PC61 capable nodes).
 13Jan23=======================================================================
 1. Periodically store Routing tables and, if they are young enough (def: 3hrs)
    autotically restore them on restart of the node. This will short circuit
index 22c82ea4ccccbaa9cb3003415b3d43bd72947d54..8c62e392f3e33046bd99b417c3d2f10f7b7d92fc 100644 (file)
@@ -317,13 +317,16 @@ sub handle_11
                        # can we promote this to a PC61?
                        my $r = Route::User::get($spot[4]); # find spotter
 
-                       if ($r && $r->ip) {                     # do we have an ip addres
+                       if ($r && $r->ip) {                     # do we have an ip address
                                $pcno = 61;
                                $pc->[0] = 'PC61';
-                               $pc->[7] = $spot[14] = $r->ip;
+                               my $hops = $pc->[8];
+                               $pc->[8] = $spot[14] = $r->ip;
                                ++$rpc11_to_61;
                                my $percent = $pc11_rx ? $rpc11_to_61 * 100 / $pc11_rx : 0;
                                dbg(sprintf("PROMOTED ROUTE $self->{call}: pc11 $key PROMOTED to pc61 with IP $spot[14] pc61: $pc61_rx pc11: $pc11_rx route->pc61 $rpc11_to_61 (%0.1f%%)", $percent)) if isdbg("pc11");
+                               $line = join '^', @$pc, $hops, '~';
+                               dbg("CHANGED saved key: $key PC11 line to $line") if isdbg('pc11');
                                delete $pc11_saved{$key};
                        }
 
@@ -356,7 +359,7 @@ sub handle_11
                $ip =~ s/^::ffff://;
                if (DXCIDR::find($ip)) {
                        dbg($line) if isdbg('nologchan');
-                       dbg("PCPROT: $ip in badip list, dropped");
+                       dbg("PCPROT: PC61 $ip in badip list, dropped");
                        return;
                }
        }