Nmap Development mailing list archives

small patch allowing build with -stdlib=libc++


From: olli hauer <ohauer () gmx de>
Date: Thu, 17 Apr 2014 21:23:49 +0200

Hi,

is it possible to adopt the following patch to make the compiler happy and also allow usage of -stdlib=libc++


Index: scan_engine.cc
===================================================================
--- scan_engine.cc      (revision 32836)
+++ scan_engine.cc      (working copy)
@@ -3129,7 +3129,7 @@
   }
   if (o.spoofsource && !bind_failed) {
     o.SourceSockAddr(&ss, &sslen);
-    if (bind(sd, (struct sockaddr*)&ss, sslen) != 0) {
+    if (::bind(sd, (struct sockaddr*)&ss, sslen) != 0) {
       error("%s: Problem binding source address (%s), errno: %d", __func__, inet_socktop(&ss), socket_errno());
       perror("bind");
       bind_failed = 1;
Index: traceroute.cc
===================================================================
--- traceroute.cc       (revision 32836)
+++ traceroute.cc       (working copy)
@@ -221,8 +221,6 @@
 /* A global random token used to distinguish this traceroute's probes from
    those of other traceroutes possibly running on the same machine. */
 static u16 global_id;
-/* A global cache of known hops, indexed by TTL and address. */
-static std::map<struct HopIdent, Hop *> hop_cache;
 /* A list of timedout hops, which are not kept in hop_cache, so we can delete
    all hops on occasion. */
 static std::list<Hop *> timedout_hops;
@@ -235,6 +233,9 @@
 static struct timeval get_now(struct timeval *now = NULL);
 static const char *ss_to_string(const struct sockaddr_storage *ss);

+/* A global cache of known hops, indexed by TTL and address. */
+static std::map<struct HopIdent, Hop *> hop_cache;
+
 struct Hop {
   Hop *parent;
   struct sockaddr_storage tag;


-- 
Regards,
olli

Attachment: stdlib=libc++.diff
Description:

_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: