Mailing List Archive

socket.t failures
Using the new Socket module in patch.1n, I finally was able to test
this on Interactive SVR3 (version 4.1).

I get a fatal failure in test 3:
$ ./perl lib/socket.t
1..6
Bad arg length for Socket::unpack_sockaddr_in, length is 256, should be
16 at lib/socket.t line 23.
ok 1
ok 2

Perhaps part of the problem is that my system by default has the following
entry in /etc/hosts:

127.1 localhost local

Note it's only got 2 numbers, not the usual (required?) 4. I'll look
into this when I get a chance, but if someone else beats me to it, I won't
complain.

Here's 'myconfig':

Summary of my perl5 (patchlevel 1) configuration:
Platform:
osname=isc, osver=3, archname=i386-isc
uname='crystal crystal 3.2 2 i386 '
hint=recommended
Compiler:
cc='cc', optimize=' ', ld='ld'
cppflags='-Xp -D_POSIX_SOURCE'
ccflags ='-Xp -D_POSIX_SOURCE'
ldflags =' -Xp'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=4, d_casti32=undef, d_castneg=undef
intsize=4, alignbytes=4, usemymalloc=y, randbits=15
Libraries:
so=so
libpth=/lib /usr/lib
libs=-linet -lnsl_s -ldbm -lld -lm -lcposix -lcrypt -lPW
libc=/lib/libc.a
Dynamic Linking:
dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef
cccdlflags='', ccdlflags='', lddlflags=''

Andy Dougherty doughera@lafcol.lafayette.edu
Re: socket.t failures [ In reply to ]
>Perhaps part of the problem is that my system by default has the following
>entry in /etc/hosts:

>127.1 localhost local

>Note it's only got 2 numbers, not the usual (required?) 4. I'll look
>into this when I get a chance, but if someone else beats me to it, I won't
>complain.

No, that shouldn't be a problem. class A addrs are A.D, meaning A.0.0.D
abbreviated.

--tom
Re: socket.t failures [ In reply to ]
> Using the new Socket module in patch.1n, I finally was able to test
> this on Interactive SVR3 (version 4.1).
>
> I get a fatal failure in test 3:
> $ ./perl lib/socket.t
> 1..6
> Bad arg length for Socket::unpack_sockaddr_in, length is 256, should be
> 16 at lib/socket.t line 23.
> ok 1
> ok 2

This means that 'getpeername' is incorrectly returning a structure of
256 bytes - and since it looks to me like getpeername in pp_sys.c
is fine, I'd hazard a guess that its the Interactive SVR3 thats
returning the wrong length - in fact its probably just not setting
the namelen arg in the getpeername system call, since 256 is the
default size passed by perl.

However, I can't see how to correct it - other than taking out
the test in Socket::unpack_sockaddr_in - maybe changing
'sockaddrlen != sizeof(addr)' to 'sockaddrlen < sizeof(addr)'.

-- Jack Shirazi, JackS@slc.com