X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fdx.pl;h=3fd00e6bb1bce1a4e56169f231d3a378095f2331;hb=refs%2Fheads%2Fnewusers;hp=9454fd702d1f4b2843ef9aa4f931620f068e7142;hpb=cbf3c0cd90df4c4df05dae6a00d03f7f9482d631;p=spider.git diff --git a/cmd/dx.pl b/cmd/dx.pl index 9454fd70..3fd00e6b 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -5,7 +5,7 @@ # # Copyright (c) 1998 Dirk Koopman G1TLH # -# $Id$ +# # my ($self, $line) = @_; @@ -120,10 +120,19 @@ if ($spotted le ' ') { return (1, @out) unless $valid; +my $ipaddr; + +if ($self->conn && $self->conn->peerhost) { + my $addr = $self->hostname; + $ipaddr = $addr unless !is_ipaddr($addr) || $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/; +} elsif ($self->inscript) { + $ipaddr = "script"; +} + # Store it here (but only if it isn't baddx) my $t = (int ($main::systime/60)) * 60; return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $t, $line, $spotter); -my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall); +my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall, $ipaddr); if ($freq =~ /^69/ || $localonly) { @@ -140,7 +149,11 @@ if ($freq =~ /^69/ || $localonly) { Spot::add(@spot); # send orf to the users - DXProt::send_dx_spot($self, DXProt::pc11($spotter, $freq, $spotted, $line), @spot); + if ($ipaddr) { + DXProt::send_dx_spot($self, DXProt::pc61($spotter, $freq, $spotted, $line, $ipaddr), @spot); + } else { + DXProt::send_dx_spot($self, DXProt::pc11($spotter, $freq, $spotted, $line), @spot); + } } }