From: Dirk Koopman Date: Tue, 26 May 2020 21:51:26 +0000 (+0100) Subject: add_thingy patch backport from mojo X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=094499a2f22de47a126106368debef0730359672 add_thingy patch backport from mojo --- diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index e642bb3c..b3a7cfcd 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -1420,32 +1420,40 @@ sub _add_thingy my ($call, $is_node, $is_extnode, $here, $version, $build, $ip) = @$s; my @rout; + # remove spurious IPV6 prefix on IPV4 addresses + $ip =~ s/^::ffff:// if $ip; + if ($call) { my $ncall = $parent->call; - if ($is_node) { - dbg("ROUTE: added node $call to $ncall") if isdbg('routelow'); - @rout = $parent->add($call, $version, Route::here($here), $ip); - my $r = Route::Node::get($call); - $r->PC92C_dxchan($dxchan->call, $hops) if $r; - if ($ip) { - $r->ip($ip); - Log('DXProt', "PC92A $call -> $ip on $ncall"); + if ($ncall ne $call) { + if ($is_node) { + dbg("ROUTE: added node $call to $ncall") if isdbg('routelow'); + @rout = $parent->add($call, $version, Route::here($here), $ip); + my $r = Route::Node::get($call); + $r->PC92C_dxchan($dxchan->call, $hops) if $r; + if ($ip) { + $r->ip($ip); + Log('DXProt', "PC92A $call -> $ip on $ncall"); + } + } else { + dbg("ROUTE: added user $call to $ncall") if isdbg('routelow'); + @rout = $parent->add_user($call, Route::here($here), $ip); + $dxchan->tell_buddies('loginb', $call, $ncall) if $dxchan; + my $r = Route::User::get($call); + if ($ip) { + $r->ip($ip); + Log('DXProt', "PC92A $call -> $ip on $ncall"); + } } - } else { - dbg("ROUTE: added user $call to $ncall") if isdbg('routelow'); - @rout = $parent->add_user($call, Route::here($here), $ip); - $dxchan->tell_buddies('loginb', $call, $ncall) if $dxchan; - my $r = Route::User::get($call); - if ($ip) { - $r->ip($ip); - Log('DXProt', "PC92A $call -> $ip on $ncall"); + if ($pc92_slug_changes && $parent == $main::routeroot) { + $things_add{$call} = Route::get($call); + delete $things_del{$call}; } - } - if ($pc92_slug_changes && $parent == $main::routeroot) { - $things_add{$call} = Route::get($call); - delete $things_del{$call}; + } else { + dbg("DXProt::add_thingy: Trying to add parent $call to itself $ncall, ignored"); } } + return @rout; }