mirror of
https://github.com/nmap/nmap.git
synced 2026-06-26 03:03:55 +00:00
Hide new logdebug messages unless o.debug.
This commit is contained in:
parent
2cda8ca150
commit
fef7fc0e6d
3 changed files with 7 additions and 4 deletions
|
|
@ -274,7 +274,8 @@ static int ncat_listen_stream(int proto)
|
|||
/* setup the main listening socket */
|
||||
listen_socket[num_sockets] = do_listen(SOCK_STREAM, proto, &listenaddrs[i]);
|
||||
if (listen_socket[num_sockets] == -1) {
|
||||
logdebug("do_listen(\"%s\"): %s\n", inet_ntop_ez(&listenaddrs[i].storage, sizeof(listenaddrs[i].storage)), socket_strerror(socket_errno()));
|
||||
if (o.debug > 0)
|
||||
logdebug("do_listen(\"%s\"): %s\n", inet_ntop_ez(&listenaddrs[i].storage, sizeof(listenaddrs[i].storage)), socket_strerror(socket_errno()));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -681,7 +682,8 @@ static int ncat_listen_dgram(int proto)
|
|||
/* create the UDP listen sockets */
|
||||
sockfd[num_sockets].fd = do_listen(SOCK_DGRAM, proto, &listenaddrs[i]);
|
||||
if (sockfd[num_sockets].fd == -1) {
|
||||
logdebug("do_listen(\"%s\"): %s\n", inet_ntop_ez(&listenaddrs[i].storage, sizeof(listenaddrs[i].storage)), socket_strerror(socket_errno()));
|
||||
if (o.debug > 0)
|
||||
logdebug("do_listen(\"%s\"): %s\n", inet_ntop_ez(&listenaddrs[i].storage, sizeof(listenaddrs[i].storage)), socket_strerror(socket_errno()));
|
||||
continue;
|
||||
}
|
||||
FD_SET(sockfd[num_sockets].fd, &listen_fds);
|
||||
|
|
|
|||
|
|
@ -939,7 +939,7 @@ static int ncat_listen_mode(void)
|
|||
rc = resolve("::", o.portno, &listenaddrs[num_listenaddrs].storage, &ss_len, AF_INET6);
|
||||
if (rc == 0)
|
||||
num_listenaddrs++;
|
||||
else
|
||||
else if (o.debug > 0)
|
||||
logdebug("Failed to resolve default IPv6 address: %s\n", gai_strerror(rc));
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -221,7 +221,8 @@ int ncat_http_server(void)
|
|||
for (i = 0; i < num_listenaddrs; i++) {
|
||||
listen_socket[num_sockets] = do_listen(SOCK_STREAM, IPPROTO_TCP, &listenaddrs[i]);
|
||||
if (listen_socket[num_sockets] == -1) {
|
||||
logdebug("do_listen(\"%s\"): %s\n", inet_ntop_ez(&listenaddrs[i].storage, sizeof(listenaddrs[i].storage)), socket_strerror(socket_errno()));
|
||||
if (o.debug > 0)
|
||||
logdebug("do_listen(\"%s\"): %s\n", inet_ntop_ez(&listenaddrs[i].storage, sizeof(listenaddrs[i].storage)), socket_strerror(socket_errno()));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue