From deb52e701a0db351d06eb6fe14872dc2fa7a51cb Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Fri, 7 Jan 2022 23:58:27 +0000 Subject: [PATCH] some final warnings removed --- cmd/dx.pl | 2 +- perl/DXProtHandle.pm | 16 ++++++++-------- perl/DXUtil.pm | 2 +- perl/Msg.pm | 1 + 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/dx.pl b/cmd/dx.pl index 7cf460cc..a5d3b425 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -172,7 +172,7 @@ if ($freq =~ /^69/ || $localonly) { } else { # send orf to the users $ipaddr ||= $main::mycall; # emergency backstop - my $spot = DXProt::pc61($spotter, $freq, $spotted, $line, $ipaddr); + my $spot = DXProt::pc61($spotter, $freq, $spotted, unpad($line), $ipaddr); $self->dx_spot(undef, undef, @spot); if ($self->isslugged) { diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 1ea3ebc9..23c17f0c 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -1560,7 +1560,6 @@ sub _decode_pc92_call my $ip; my $version = $part[1] || 0; my $build = $part[2] || 0; - $build =~ s/\D+//g; my $ip = $part[3] || ''; if ($version =~ /[,.]/) { @@ -1570,8 +1569,13 @@ sub _decode_pc92_call $version =~ s/\D+//g; $build =~ s/^0\.//; $build =~ s/\D+//g; - $ip =~ s/,/:/g if $ip; - return ($call, $is_node, $is_extnode, $here, $version, $build, $ip); + if ($ip) { + $ip =~ s/,/:/g; + $ip =~ s/^::ffff://i; + } + dbg("$icall = '" . join("', '", $call, $is_node, $is_extnode, $here, $version, $build, $ip) . "'") if isdbg('pc92'); + + return ($call, $is_node, $is_extnode, $here, $version+0, $build+0, $ip); } # decode a pc92 call: flag call : version : build @@ -1602,6 +1606,7 @@ sub _encode_pc92_call $ip =~ s/:/,/g; $extra .= ':' . $ip; } + return "$flag$call$extra"; } @@ -1618,11 +1623,6 @@ 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; - $build ||= 0; - $version ||= 0; - if ($call) { my $ncall = $parent->call; if ($ncall ne $call) { diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 51272d74..be6dfb4d 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -222,7 +222,7 @@ sub phash my $ref = shift; my $out; - while (my $k = sort keys %$ref) { + foreach my $k (sort keys %$ref) { $out .= "${k}=>$ref->{$k}, "; } $out =~ s/, $// if $out; diff --git a/perl/Msg.pm b/perl/Msg.pm index 8992d3c1..9a6f8d1f 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -133,6 +133,7 @@ sub peerhost $conn->{peerhost} ||= $conn->{sock}->handle->peerhost if $conn->{sock}; $conn->{peerhost} ||= 'UNKNOWN'; } + $conn->{peerhost} =~ s/^::ffff://; return $conn->{peerhost}; } -- 2.43.0