X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FDXProtHandle.pm;h=b051fad35c201533c8451443f66e8c95fcc02c17;hb=56fd7417545aa9de3101434bc88156b5eebb37ab;hp=1ea3ebc97bd2cb1b3326eedc830ffe4ffdeb2737;hpb=007511abd2f678130afcc778d60bad0447411b0b;p=spider.git diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 1ea3ebc9..b051fad3 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -1560,18 +1560,25 @@ 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 =~ /[,.]/) { + if (is_ipaddr($version)) { $ip = $version; $version = 0; } - $version =~ s/\D+//g; + $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); + $build =~ s/\D//g; + $version ||= 0; + $build ||= 0; + + 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 +1609,7 @@ sub _encode_pc92_call $ip =~ s/:/,/g; $extra .= ':' . $ip; } + return "$flag$call$extra"; } @@ -1618,11 +1626,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) {