Small fix to whoisd.pl
Laurent Joncheray
Wed May 3 22:05:02 CEST 1995
Well, you are welcome to try our server. whois -h whois.ra.net <foo>. and compare the response time with the one at RIPE. The most dificult is to take into account the type of machine and the network delay/bandwith. But i am sure you'll figure out. Laurent In our previous episode, Tony Bates said: > > I always though it was going too slow to read the conf file each > time. Does this turn out not to be the case ? > > --Tony. > > Laurent Joncheray <lpj at merit.edu> writes: > * It is an old issue but... > * why don't you port whoisd to be called from [x]inetd. So you > * won't need any networking hack. It has been like that on radb.ra.net, > * and it seems to be fine. > * Laurent > * PS: lot of advantages: do not need to run as root, IP filtering, logging, > * > * In our previous episode, Tony Bates said: > * > > * > 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 return > * s > * > 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. > * > > * > * > * -- > * Laurent Joncheray, E-Mail: lpj at merit.edu > * Merit Network Inc, 4251 Plymouth Rd, Suite C, Phone: +1 (313) 936 20 > * 65 > * Ann Arbor, MI 48105, USA Fax: +1 (313) 747 31 > * 85 > * "This is the end, Beautiful friend. This is the end, My only friend, the en > * d" JM > -- Laurent Joncheray, E-Mail: lpj at merit.edu Merit Network Inc, 4251 Plymouth Rd, Suite C, Phone: +1 (313) 936 2065 Ann Arbor, MI 48105, USA Fax: +1 (313) 747 3185 "This is the end, Beautiful friend. This is the end, My only friend, the end" JM -------- Logged at Wed May 3 22:39:20 MET DST 1995 ---------
[ rr-impl Archive ]