1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$NetBSD: patch-aa,v 1.3 2005/11/03 16:45:13 tv Exp $
--- osfinger.c.orig 2002-07-21 02:49:32.000000000 -0400
+++ osfinger.c
@@ -33,6 +33,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
+#include <arpa/inet.h>
#include <signal.h>
#include "arirang.h"
@@ -71,7 +72,14 @@ osdetect(char *scanhost)
}
snprintf(osfinger, sizeof(osfinger), "GET %s%s HTTP/1.0\n\n", NETCRAFT_FINGER, scanhost);
send(sock, osfinger, strlen(osfinger), 0);
- recv(sock, headBuff, sizeof(headBuff), MSG_WAITALL);
+
+ {
+ int toRead = sizeof(headBuff);
+ int wasRead;
+
+ while ((wasRead = recv(sock, headBuff, toRead, 0)) > 0)
+ toRead -= wasRead;
+ }
ptr = strstr(headBuff, "running <b>");
|