From 5167e718e090d2869a02cdba98760c069a8948c3 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Thu, 26 Nov 2009 12:58:28 +0000 Subject: [PATCH 1/1] add logging of PC92A ip addresses --- perl/DXProtHandle.pm | 16 +++++++++++++--- perl/Msg.pm | 4 ++++ perl/Version.pm | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 90e7f471..c5d4bf4e 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -1404,15 +1404,25 @@ sub _add_thingy my @rout; if ($call) { + my $ncall = $parent->call; if ($is_node) { - dbg("ROUTE: added node $call to " . $parent->call) if isdbg('routelow'); + 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 " . $parent->call) if isdbg('routelow'); + dbg("ROUTE: added user $call to $ncall") if isdbg('routelow'); @rout = $parent->add_user($call, Route::here($here), $ip); - $dxchan->tell_buddies('loginb', $call, $parent->call) if $dxchan; + $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); diff --git a/perl/Msg.pm b/perl/Msg.pm index c9b58a48..531bff73 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -196,6 +196,10 @@ sub pid_gone sub peerhost { my $self = shift; + my $ip; + unless ($self->{peerhost}) { + $self->{peerhost} = $self->{sock}->peerhost; + } return $self->{peerhost}; } diff --git a/perl/Version.pm b/perl/Version.pm index 8c8f5500..605dca63 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.55'; $subversion = '0'; -$build = '56'; +$build = '57'; 1; -- 2.43.0