View | Details | Raw Unified | Return to bug 232934
Collapse All | Expand All

(-)security/nmap/files/patch-nping_EchoServer.cc (+32 lines)
Line 0 Link Here
1
--- nping/EchoServer.cc.orig	2018-01-28 21:18:17 UTC
2
+++ nping/EchoServer.cc
3
@@ -281,12 +281,12 @@ int EchoServer::nep_listen_socket(){
4
         server_addr6.sin6_len = sizeof(struct sockaddr_in6);
5
     #endif
6
     /* Bind to local address and the specified port */
7
-    if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
8
+    if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
9
         nping_warning(QT_3, "Failed to bind to source address %s. Trying to bind to port %d...", IPtoa(server_addr6.sin6_addr), port);
10
         /* If the bind failed for the supplied address, just try again with in6addr_any */
11
         if( o.spoofSource() ){
12
             server_addr6.sin6_addr = in6addr_any;
13
-            if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
14
+            if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
15
                 nping_fatal(QT_3, "Could not bind to port %d (%s).", port, strerror(errno));
16
             }else{ 
17
                 nping_print(VB_1, "Server bound to port %d", port);
18
@@ -319,12 +319,12 @@ int EchoServer::nep_listen_socket(){
19
 #endif
20
 
21
     /* Bind to local address and the specified port */
22
-    if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
23
+    if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
24
         nping_warning(QT_3, "Failed to bind to source address %s. Trying to bind to port %d...", IPtoa(server_addr4.sin_addr), port);
25
         /* If the bind failed for the supplied address, just try again with in6addr_any */
26
         if( o.spoofSource() ){
27
             server_addr4.sin_addr.s_addr=INADDR_ANY;
28
-            if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
29
+            if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
30
                 nping_fatal(QT_3, "Could not bind to port %d (%s).", port, strerror(errno));
31
             }else{
32
                 nping_print(VB_1, "Server bound to port %d", port);

Return to bug 232934