Small fix to whoisd.pl
Tony Bates
Wed May 3 20:39:52 CEST 1995
Hi, I am in the process of porting the RR stuff to run on Slowaris (SunOS 5.4 to be exact ) and came across this amazing horrible nit which we should reflect back in the src. In the whoisd code we do a setsockopt so we can reuse the address like so: setsockopt(S, $SOL_SOCKET, $SO_REUSEADDR, 1) || die "setsockopt: $!"; Unfortunately, the value of OPTVAL (1) in the c source of perl is not tranlated properly into a pointer to an integer as it needs to be for the system call to work properly. The odd thing is on SunOS4.1.3 the setsockopt routine doesn't actually care if it is wrong. After hacking the perl code and lots of debugging to gdb we (thanks Dennis for considerable gdb help) found the SunOS5.4 networking code does and returns invalid argument. The awful fix is to do the following. Change the lines to: $on = "\0\0\001"; setsockopt(S, $SOL_SOCKET, $SO_REUSEADDR, $on) || die "setsockopt: $!"; Or some such. This actually fakes the c code to do the right thing and actually make the you get a point to int with a non-zero value. This is a terrible and also annoying as in perl5 all this code is re-written as it is done properly. Anyway, you may want to test and reflect this change back in the source. Cheers, --Tony. -------- Logged at Wed May 3 20:48:01 MET DST 1995 ---------
[ rr-impl Archive ]