From 60bce6425dada83afe09ae003c66e96774154d29 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 21 Sep 2018 06:37:15 +0000 Subject: [PATCH] nmap: Fix build with latest clang&libc++ --- packages/nmap/nping-EchoServer.cc.patch | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/nmap/nping-EchoServer.cc.patch diff --git a/packages/nmap/nping-EchoServer.cc.patch b/packages/nmap/nping-EchoServer.cc.patch new file mode 100644 index 000000000..bd05fd483 --- /dev/null +++ b/packages/nmap/nping-EchoServer.cc.patch @@ -0,0 +1,33 @@ +diff -u -r ../nmap-7.70/nping/EchoServer.cc ./nping/EchoServer.cc +--- ../nmap-7.70/nping/EchoServer.cc 2018-01-28 21:18:17.000000000 +0000 ++++ ./nping/EchoServer.cc 2018-09-21 06:35:10.405423943 +0000 +@@ -281,12 +281,12 @@ + server_addr6.sin6_len = sizeof(struct sockaddr_in6); + #endif + /* Bind to local address and the specified port */ +- if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){ ++ if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){ + nping_warning(QT_3, "Failed to bind to source address %s. Trying to bind to port %d...", IPtoa(server_addr6.sin6_addr), port); + /* If the bind failed for the supplied address, just try again with in6addr_any */ + if( o.spoofSource() ){ + server_addr6.sin6_addr = in6addr_any; +- if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){ ++ if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){ + nping_fatal(QT_3, "Could not bind to port %d (%s).", port, strerror(errno)); + }else{ + nping_print(VB_1, "Server bound to port %d", port); +@@ -319,12 +319,12 @@ + #endif + + /* Bind to local address and the specified port */ +- if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){ ++ if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){ + nping_warning(QT_3, "Failed to bind to source address %s. Trying to bind to port %d...", IPtoa(server_addr4.sin_addr), port); + /* If the bind failed for the supplied address, just try again with in6addr_any */ + if( o.spoofSource() ){ + server_addr4.sin_addr.s_addr=INADDR_ANY; +- if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){ ++ if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){ + nping_fatal(QT_3, "Could not bind to port %d (%s).", port, strerror(errno)); + }else{ + nping_print(VB_1, "Server bound to port %d", port);