11 --- a/nping/EchoServer.cc
12 +++ b/nping/EchoServer.cc
14 #include "EchoServer.h"
15 #include "EchoHeader.h"
16 #include "NEPContext.h"
21 @@ -281,12 +282,12 @@ int EchoServer::nep_listen_socket(){
22 server_addr6.sin6_len = sizeof(struct sockaddr_in6);
24 /* Bind to local address and the specified port */
25 - if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
26 + if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
27 nping_warning(QT_3, "Failed to bind to source address %s. Trying to bind to port %d...", IPtoa(server_addr6.sin6_addr), port);
28 /* If the bind failed for the supplied address, just try again with in6addr_any */
29 if( o.spoofSource() ){
30 server_addr6.sin6_addr = in6addr_any;
31 - if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
32 + if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
33 nping_fatal(QT_3, "Could not bind to port %d (%s).", port, strerror(errno));
35 nping_print(VB_1, "Server bound to port %d", port);
36 @@ -319,12 +320,12 @@ int EchoServer::nep_listen_socket(){
39 /* Bind to local address and the specified port */
40 - if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
41 + if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
42 nping_warning(QT_3, "Failed to bind to source address %s. Trying to bind to port %d...", IPtoa(server_addr4.sin_addr), port);
43 /* If the bind failed for the supplied address, just try again with in6addr_any */
44 if( o.spoofSource() ){
45 server_addr4.sin_addr.s_addr=INADDR_ANY;
46 - if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
47 + if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){
48 nping_fatal(QT_3, "Could not bind to port %d (%s).", port, strerror(errno));
50 nping_print(VB_1, "Server bound to port %d", port);
65 #include "struct_ip.h"