blob: a5c12c2153b49d39fd57d066f936d0a418a5991a [file] [log] [blame]
From 5bbe66f1bd8cbd3718f5805139e2e8139e6849bb Mon Sep 17 00:00:00 2001
From: David Carlos Manuelda <StormByte@gmail.com>
Date: Sun, 21 Oct 2018 12:32:40 +0200
Subject: [PATCH] Fix clang build:
* Fixed missing <time.h> include for referencing time function
* Fixed missing :: for referencing to std::bind
---
nmap_error.cc | 1 +
nping/EchoServer.cc | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/nmap_error.cc b/nmap_error.cc
index df7f083cd9..2746625d38 100644
--- a/nmap_error.cc
+++ b/nmap_error.cc
@@ -135,6 +135,7 @@
#include "xml.h"
#include <errno.h>
+#include <time.h>
extern NmapOps o;
diff --git a/nping/EchoServer.cc b/nping/EchoServer.cc
index 70f39b0f21..2ca3bc9a63 100644
--- a/nping/EchoServer.cc
+++ b/nping/EchoServer.cc
@@ -281,12 +281,12 @@ int EchoServer::nep_listen_socket(){
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 @@ int EchoServer::nep_listen_socket(){
#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);