summaryrefslogtreecommitdiff
path: root/net/nmap/patches/patch-nping_EchoServer.cc
blob: e90c6e4341ef826f6d328c849116ebf222a5c109 (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
35
36
$NetBSD: patch-nping_EchoServer.cc,v 1.1 2020/03/18 17:58:43 joerg Exp $

Don't match std::bind.

--- nping/EchoServer.cc.orig	2020-03-18 16:55:31.850840039 +0000
+++ 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);