Binding to Localhost problem with perl 5.6.1 
Author Message
 Binding to Localhost problem with perl 5.6.1

Sorry if this is a constant question... (I'm not really the perl
programmer, just asking something that my programmers are not too sure
of)

We have some perl code that was working fine in binding to a listener
port in using the following code:

Example:

my $main_sock = new IO::Socket::INET(LocalHost => 'localhost',
                                     LocalPort => 1234,
                                     Listen => 5,
                                     Proto => 'tcp',
                                     Reuse => 1);

With perl 5.005_03 this caused the listener to listen on the
interfaces eth0 and lo.  A netstat -at command would look like the
following:

tcp        0      0 *:1234                  *:*      LISTEN

After upgrading the perl for my programmers to 5.6.1 the listener now
binds to localhost (lo).  The netstat now looks like this:

tcp        0      0 localhost:1234          *:*      LISTEN

This issue now causes external machines to get a connection refused.

Now for my question:

What caused this "security" feature and how can it be fixed so the
listener listens for any traffic...  I hope this makes some sense..
Thanks in advance for any help!

Jeff



Tue, 31 Aug 2004 03:31:10 GMT  
 Binding to Localhost problem with perl 5.6.1
Hi,

I'm not sure why 5.6.1 behaves different, but try to omit the
LocalHost parameter altogether. At least on my W2K Machines this binds
to all interfaces.

my $main_sock = new IO::Socket::INET(
                                     LocalPort => 1234,
                                     Listen => 5,
                                     Proto => 'tcp',
                                     Reuse => 1);

Thomas



Quote:
> Sorry if this is a constant question... (I'm not really the perl
> programmer, just asking something that my programmers are not too
sure
> of)

> We have some perl code that was working fine in binding to a
listener
> port in using the following code:

> Example:

> my $main_sock = new IO::Socket::INET(LocalHost => 'localhost',
>                                      LocalPort => 1234,
>                                      Listen => 5,
>                                      Proto => 'tcp',
>                                      Reuse => 1);

> With perl 5.005_03 this caused the listener to listen on the
> interfaces eth0 and lo.  A netstat -at command would look like the
> following:

> tcp        0      0 *:1234                  *:*      LISTEN

> After upgrading the perl for my programmers to 5.6.1 the listener
now
> binds to localhost (lo).  The netstat now looks like this:

> tcp        0      0 localhost:1234          *:*      LISTEN

> This issue now causes external machines to get a connection refused.

> Now for my question:

> What caused this "security" feature and how can it be fixed so the
> listener listens for any traffic...  I hope this makes some sense..
> Thanks in advance for any help!

> Jeff




Wed, 01 Sep 2004 02:06:02 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help: localhost Apache and @INC problem.

2. Problem: Line terminator for localhost sockets

3. socket problems: can't resolve localhost

4. perl script generates sendmail NOQUEUE: connect from root@localhost

5. Running Perl Script From Localhost

6. BIND in perl, no bind

7. Problem with bind() on perl 4.0.1.6 with CRAY/UNICOS

8. Sockets bind() problem in Perl

9. Perl Tk 'bind' problem

10. connect to localhost failed error with Mail::Sendmail on Windows

11. folder paths on localhost

12. Server Push on Apache localhost?

 

 
Powered by phpBB® Forum Software