summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi-Wen Hsu <lwhsu@FreeBSD.org>2018-12-27 08:51:32 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2018-12-27 08:51:32 +0000
commitd733b3eddc556f6eebd3195886eddc841d8a3dba (patch)
tree3ed9c493a8ed0cf83c9a019a023781d8b53f1de4
parente7db1030de5c109e693254e95552b9c22a8fc566 (diff)
downloadfreebsd-ports-d733b3eddc556f6eebd3195886eddc841d8a3dba.zip
- Fix build with libc++ 7.0
PR: 232934 Submitted by: dim Approved by: maintainer timeout Sponsored by: The FreeBSD Foundation
-rw-r--r--security/nmap/files/patch-nping_EchoServer.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/security/nmap/files/patch-nping_EchoServer.cc b/security/nmap/files/patch-nping_EchoServer.cc
new file mode 100644
index 000000000000..9e5e551eb10e
--- /dev/null
+++ b/security/nmap/files/patch-nping_EchoServer.cc
@@ -0,0 +1,32 @@
+--- nping/EchoServer.cc.orig 2018-01-28 21:18:17 UTC
++++ 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);