pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/nmap Help the compiler find the right bind



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6fed233905d8
branches:  trunk
changeset: 425086:6fed233905d8
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Mar 18 17:58:43 2020 +0000

description:
Help the compiler find the right bind

diffstat:

 net/nmap/distinfo                          |   3 +-
 net/nmap/patches/patch-nping_EchoServer.cc |  36 ++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletions(-)

diffs (55 lines):

diff -r 6e3d7d5452b4 -r 6fed233905d8 net/nmap/distinfo
--- a/net/nmap/distinfo Wed Mar 18 17:57:30 2020 +0000
+++ b/net/nmap/distinfo Wed Mar 18 17:58:43 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.78 2019/08/28 13:55:44 adam Exp $
+$NetBSD: distinfo,v 1.79 2020/03/18 17:58:43 joerg Exp $
 
 SHA1 (nmap-7.80.tar.bz2) = cfd8162192cfe2623f5770b8ed3c6237791ff6bf
 RMD160 (nmap-7.80.tar.bz2) = f9e2a71733fd25db98681286c9c2bf23d41bdd71
@@ -7,4 +7,5 @@
 SHA1 (patch-configure) = 5fc39f084eadd6ea0560cd8e6f52074113566600
 SHA1 (patch-libdnet-stripped_src_arp-bsd.c) = c56c4e70eca2fa04dd8aab38ed2c3f4cac83f5e3
 SHA1 (patch-libnetutil_netutil.cc) = 7bd1059d6cbcf4f6d129730d6c6f6bc3ab54c0a0
+SHA1 (patch-nping_EchoServer.cc) = e5b0213e3cfff8a32b5ae291c1921a86b9b17dd3
 SHA1 (patch-nsock_tests_run__tests.sh) = 88a7447f93dd3377e7e24e317c55528a73a17401
diff -r 6e3d7d5452b4 -r 6fed233905d8 net/nmap/patches/patch-nping_EchoServer.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/nmap/patches/patch-nping_EchoServer.cc        Wed Mar 18 17:58:43 2020 +0000
@@ -0,0 +1,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);



Home | Main Index | Thread Index | Old Index