X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=cmd%2Fdx.pl;h=d8dd56cbbd7ee76bf0507242d3eea7d9d8ee1ead;hp=1836f1fe979d7f5529c827d64c9910aec95911fb;hb=cd5b993f99b52d3c3c51779e9ea1fa150232225e;hpb=2292ddaa6a89373d07cbe9e6f235ab2bb45b1e92 diff --git a/cmd/dx.pl b/cmd/dx.pl index 1836f1fe..d8dd56cb 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -120,10 +120,17 @@ if ($spotted le ' ') { return (1, @out) unless $valid; +my $ipaddr; + +if ($self->conn->peerhost) { + my $addr = $self->conn->peerhost; + $ipaddr = $addr unless !is_ipaddr($addr) || $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/; +} + # 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 +147,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); + } } }