Discussion:
nasl_recv timeout
f***@qq.com
2014-10-11 15:25:10 UTC
Permalink
Hi,

I built openvas-nasl in windows with cygwin.
Now everything looks fine except that when running the script "rip_detect.nasl", as I found out, it runs slow and the trace log (I added time stamps) shows:

Sat Oct 11 17:34:46 2014 [7956](/cygdrive/c/openvas/plugins/rip_detect.nasl) NASL> Call recv(socket: 68, length: 512, timeout: 3)
Sat Oct 11 17:36:08 2014 [7956](/cygdrive/c/openvas/plugins/rip_detect.nasl) NASL> Return recv: NULL
...
Sat Oct 11 17:36:08 2014 [7956]() NASL> [0x8261a508] <- 3
Sat Oct 11 17:36:08 2014 [7956](/cygdrive/c/openvas/plugins/rip_detect.nasl) NASL> Call recv(socket: 69, length: 512, timeout: 3)
Sat Oct 11 17:38:49 2014 [7956](/cygdrive/c/openvas/plugins/rip_detect.nasl) NASL> Return recv: NULL
...
Sat Oct 11 17:38:49 2014 [7956](/cygdrive/c/openvas/plugins/rip_detect.nasl) NASL> Call recv(socket: 69, length: 512, timeout: 3)
Sat Oct 11 17:41:31 2014 [7956](/cygdrive/c/openvas/plugins/rip_detect.nasl) NASL> Return recv: NULL

and with the same target and preferences, the openvas-scanner in cent-os shows:

Sat Oct 11 17:25:23 2014 [57413](/usr/var/lib/openvas/plugins/rip_detect.nasl) NASL> Call recv(socket: 8, length: 512, timeout: 3)
Sat Oct 11 17:25:24 2014 [57413](/usr/var/lib/openvas/plugins/rip_detect.nasl) NASL> Return recv: NULL
...
Sat Oct 11 17:25:24 2014 [57413](/usr/var/lib/openvas/plugins/rip_detect.nasl) NASL> Call recv(socket: 8, length: 512, timeout: 3)
Sat Oct 11 17:25:26 2014 [57413](/usr/var/lib/openvas/plugins/rip_detect.nasl) NASL> Return recv: NULL
...
Sat Oct 11 17:25:24 2014 [57413](/usr/var/lib/openvas/plugins/rip_detect.nasl) NASL> Call recv(socket: 8, length: 512, timeout: 3)
Sat Oct 11 17:25:26 2014 [57413](/usr/var/lib/openvas/plugins/rip_detect.nasl) NASL> Return recv: NULL

Why does the function nasl_recv cost so much time, neglect the timeout of 3 seconds in windows? While it works fine in cent-os.
BTW, there seems to be not so much discuss threads in openvas-devel mailing list, no questions no answers. I posted this question to it and there's no answer either.

Thanks!



flymolon

Loading...