clarify how and when PC92 A/D are rebroadcast
[spider.git] / perl / DXProtHandle.pm
index 600bfd8f61db19163be7fdae8cb3da3de426d5fc..b04536e4bc2e374f8b4be35f788bef16d9848181 100644 (file)
@@ -49,7 +49,7 @@ use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restim
                        $eph_pc15_restime $pc9x_past_age $pc9x_dupe_age
                        $pc10_dupe_age $pc92_slug_changes $last_pc92_slug
                        $pc92Ain $pc92Cin $pc92Din $pc92Kin $pc9x_time_tolerance
-                       $pc92filterdef $senderverify $pc11_dwell_time $pc11_extract_route $pc92_ad_enabled $pc92c_ipaddr_enable
+                       $pc92filterdef $senderverify $pc11_dwell_time $pc11_extract_route $pc92_ad_enabled $pc92c_ipaddr_enabled
                   );
 
 $pc9x_dupe_age = 60;                   # catch loops of circular (usually) D records
@@ -2321,8 +2321,11 @@ sub handle_92
                $self->route_pc16($pcall, undef, $parent, @pc16) if @pc16;
        }
 
-       # broadcast it if we get here
-       $self->broadcast_route_pc9x($pcall, undef, $line, 0) unless !$pc92_ad_enabled && ($sort eq 'A' || $sort eq 'D');
+       # broadcast it if we get here (but not if it's an A or D record and pc92_ad_enabled isn't set;
+       if ($sort eq 'A' || $sort eq 'D') {
+               return unless $pc92_ad_enabled;
+       }
+       $self->broadcast_route_pc9x($pcall, undef, $line, 0);
 }
 
 # get all the routes for a thing, bearing in mind that the thing (e.g. a user)
@@ -2390,8 +2393,10 @@ sub handle_93
        my $text = $pc->[6];
        my $onode = uc $pc->[7];
        my $ipaddr = $pc->[8];
-       
+
+       $onode = undef unless $onode && is_callsign($onode);
        $onode //= $pcall;
+       $ipaddr = undef unless $ipaddr && is_ipaddr($ipaddr);
 
        # this is catch loops caused by bad software ...
        if (eph_dup("PC93|$from|$text|$onode", $pc10_dupe_age)) {
@@ -2510,10 +2515,11 @@ sub handle_default
        }
 }
 
+# does what it says on the tin..
 sub populate_routing_table
 {
        my ($self, $node, $user, $ip) = @_;
-
+       
        my $rn = Route::Node::get($node);
        unless ($rn) {
                $rn = Route::Node->new($node);