add localhost client aliasing on spots and PC92A
[spider.git] / perl / DXCommandmode.pm
index 90812225dfe772c4bd8b2671f6ff3600bc70a521..3226399746a15385b4582544994e4c0f7b959ba9 100644 (file)
@@ -74,8 +74,11 @@ sub new
        # routing, this must go out here to prevent race condx
        my $pkg = shift;
        my $call = shift;
-#      my @rout = $main::routeroot->add_user($call, Route::here(1));
-       DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1, undef, undef, $self->hostname], );
+       #       my @rout = $main::routeroot->add_user($call, Route::here(1));
+       my $ipaddr = $self->hostname;
+       $ipaddr = $main::localhost_alias_ipv6 if $ipaddr eq '::1' && $main::localhost_alias_ipv6;
+       $ipaddr = $main::localhost_alias_ipv4 if $ipaddr =~ /^127\./ && $main::localhost_alias_ipv4;
+       DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1, undef, undef, $ipaddr], );
 
        # ALWAYS output the user
        my $ref = Route::User::get($call);