summaryrefslogtreecommitdiff
path: root/net/kdenetwork3/patches/patch-ar
blob: d34a65bc67b01d3496e59ddf762f6c79941e9113 (plain)
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
29
30
31
32
33
34
$NetBSD: patch-ar,v 1.1 2002/12/04 21:20:07 skrll Exp $

--- lanbrowsing/lisa/netscanner.cpp.orig	Sat Feb  2 22:27:59 2002
+++ lanbrowsing/lisa/netscanner.cpp
@@ -36,6 +36,10 @@
 #include <netinet/ip.h>
 #include <netinet/ip_icmp.h>
 
+#ifndef INADDR_NONE
+#define INADDR_NONE -1
+#endif
+
 #define mgetDebug() getDebug()<<procId
 
 struct ICMPEchoRequest
@@ -133,7 +137,7 @@ void NetScanner::configure(Config& confi
       {
          if ((m_strictMode) && (hostsAdded>=STRICTMODEMAXHOSTS))
             break;
-         memcpy(&server_addr, hp->h_addr, hp->h_length);
+         memcpy(&server_addr, hp->h_addr, sizeof(server_addr));
          char *ip=inet_ntoa(server_addr);
          mgetDebug()<<"NetScanner::configure(): looking up "<<nextName<<" gives -"<<ip<<"-"<<std::endl;
          ipRangeStr=ipRangeStr+ip+';';
@@ -377,6 +381,9 @@ void NetScanner::nmblookupScan(SimpleLis
          };
       };
    } while (!done);
+
+   // Warning: The return value of plcose may be incorrect due to the
+   // SIGCHLD handler that is installed. Ignore it!
    pclose(nmblookupFile);
 
    delete [] tmpBuf;