don't attempt connect() to bogus IP addresses
Graham Barr [Sun, 31 Jan 1999 21:50:45 +0000 (15:50 -0600)]
Message-Id: <19990131215045.A633@pobox.com>

p4raw-id: //depot/perl@2743

t/lib/io_multihomed.t

index 3d7188b..d9b96c0 100644 (file)
@@ -55,8 +55,14 @@ sub connect
        my($port, $addr) = unpack_sockaddr_in($_[0]);
        $addr = inet_ntoa($addr);
        #print "connect($self, $port, $addr)\n";
-       print "ok 3\n" if $addr eq "10.250.230.10";
-       print "ok 4\n" if $addr eq "10.250.230.12";
+       if($addr eq "10.250.230.10") {
+           print "ok 3\n";
+           return 0;
+       }
+       if($addr eq "10.250.230.12") {
+           print "ok 4\n";
+           return 0;
+       }
     }
     $self->SUPER::connect(@_);
 }