mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
Don't associate nsock logging info to a nspool.
Make current loglevel and current log callback global to the library. Attaching them to the nsock pool doesn't bring any benefit and prevents from logging activity in code sections that don't have access to a pool (such as proxy chain specification parsing). Updated external calls and nsock tests accordingly.
This commit is contained in:
@@ -191,8 +191,8 @@ void FPNetworkControl::init(const char *ifname, devtype iftype) {
|
||||
if ((this->nsp = nsock_pool_new(NULL)) == NULL)
|
||||
fatal("Unable to obtain an Nsock pool");
|
||||
|
||||
nsock_set_log_function(this->nsp, nmap_nsock_stderr_logger);
|
||||
nmap_adjust_loglevel(this->nsp, o.packetTrace());
|
||||
nsock_set_log_function(nmap_nsock_stderr_logger);
|
||||
nmap_adjust_loglevel(o.packetTrace());
|
||||
|
||||
nsock_pool_set_device(nsp, o.device);
|
||||
|
||||
@@ -420,7 +420,7 @@ int FPNetworkControl::setup_sniffer(const char *iface, const char *bpf_filter) {
|
||||
/* This method makes the controller process pending events (like packet
|
||||
* transmissions or packet captures). */
|
||||
void FPNetworkControl::handle_events() {
|
||||
nmap_adjust_loglevel(nsp, o.packetTrace());
|
||||
nmap_adjust_loglevel(o.packetTrace());
|
||||
nsock_loop(nsp, 50);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user