When we call open_sock_udp(port), fd value returned is 4 and upwards on multiple calls. So, when nasl_close_socket() is called, it justs returns without closing the local port bound to the socket, when the fd value is 4. A minor issue.
Chandra. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bernhard Herzog Sent: Wednesday, August 06, 2008 3:39 PM To: [email protected] Subject: Re: [Openvas-devel] [Openvas-commits] r1103 -trunk/openvas-libnasl/nasl [EMAIL PROTECTED] writes: > Fixed an issue with UDP socket close in nasl_close_socket [...] > --- trunk/openvas-libnasl/nasl/nasl_socket.c 2008-08-04 09:16:50 UTC (rev 1102) > +++ trunk/openvas-libnasl/nasl/nasl_socket.c 2008-08-06 09:41:14 UTC (rev 1103) > @@ -612,7 +612,7 @@ > int e; > > soc = get_int_var_by_num(lexic, 0, -1); > - if(soc <= 4) > + if(soc < 4) > { > nasl_perror(lexic, "close(): invalid argument\n"); > return NULL; This seems a bit strange. What problem does that fix, exactly? And what's the relevance of the number 4 here? Why don't the other NASL functions that accept sockets as parameters contain similar checks? Bernhard -- Bernhard Herzog Intevation GmbH, Osnabrück Amtsgericht Osnabrück, HR B 18998 http://www.intevation.de/ Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner _______________________________________________ Openvas-devel mailing list [email protected] http://lists.wald.intevation.org/mailman/listinfo/openvas-devel _______________________________________________ Openvas-devel mailing list [email protected] http://lists.wald.intevation.org/mailman/listinfo/openvas-devel
