fix DXCommandmode::run_cmd to detect errors earlier
[spider.git] / perl / ExtMsg.pm
index dd97475aaa6a336be70186f2155e629f708d2f30..ae50f036568c57a02596f1d70b40c38260289876 100644 (file)
@@ -104,7 +104,7 @@ sub dequeue
                                $msg = uc $msg;
                                if (is_callsign($msg) && $msg !~ m|/| ) {
                                        my $sort = $conn->{csort};
-                                       $sort = 'local' if $conn->{peerhost} eq "127.0.0.1";
+                                       $sort = 'local' if $conn->{peerhost} =~ /127\.\d+\.\d+\.\d+$/ || $conn->{peerhost} eq '::1';
                                        my $uref;
                                        if ($main::passwdreq || ($uref = DXUser->get_current($msg)) && $uref->passwd ) {
                                                $conn->conns($msg);
@@ -126,7 +126,7 @@ sub dequeue
                                        my $sort = $conn->{csort};
                                        $conn->{echo} = $conn->{decho};
                                        delete $conn->{decho};
-                                       $sort = 'local' if $conn->{peerhost} eq "127.0.0.1";
+                                       $sort = 'local' if $conn->{peerhost} =~ /127\.\d+\.\d+\.\d+$/ || $conn->{peerhost} eq '::1';
                                        $conn->{usedpasswd} = 1;
                                        $conn->to_connected($conn->{call}, 'A', $sort);
                                } else {