diff --git a/FPEngine.cc b/FPEngine.cc index 050b9e84a..667461762 100644 --- a/FPEngine.cc +++ b/FPEngine.cc @@ -158,6 +158,7 @@ void FPNetworkControl::init(const char *ifname, devtype iftype) { /* Create a new nsock pool */ if ((this->nsp = nsp_new(NULL)) == NULL) fatal("Unable to obtain an Nsock pool"); + nsp_setdevice(nsp, o.device); /* Set Trace level */ if (o.packetTrace()) { diff --git a/nmap_dns.cc b/nmap_dns.cc index 8aa9ddfed..04f2d34ca 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -1210,6 +1210,7 @@ static void nmap_mass_rdns_core(Target **targets, int num_targets) { if ((dnspool = nsp_new(NULL)) == NULL) fatal("Unable to create nsock pool in %s()", __func__); + nsp_setdevice(dnspool, o.device); if ((lasttrace = o.packetTrace())) nsp_settrace(dnspool, NULL, NSOCK_TRACE_LEVEL, o.getStartTime()); diff --git a/nping/ProbeMode.cc b/nping/ProbeMode.cc index b069ad3d2..90a1c901c 100644 --- a/nping/ProbeMode.cc +++ b/nping/ProbeMode.cc @@ -122,6 +122,7 @@ int ProbeMode::init_nsock(){ /* Create a new nsock pool */ if ((nsp = nsp_new(NULL)) == NULL) outFatal(QT_3, "Failed to create new pool. QUITTING.\n"); + nsp_setdevice(nsp, o.getDevice()); /* Allow broadcast addresses */ nsp_setbroadcast(nsp, 1); diff --git a/nse_nsock.cc b/nse_nsock.cc index b432b48e7..acbb69995 100644 --- a/nse_nsock.cc +++ b/nse_nsock.cc @@ -80,6 +80,7 @@ static nsock_pool new_pool (lua_State *L) { nsock_pool nsp = nsp_new(NULL); nsock_pool *nspp; + nsp_setdevice(nsp, o.device); nsp_setbroadcast(nsp, true); nspp = (nsock_pool *) lua_newuserdata(L, sizeof(nsock_pool)); *nspp = nsp; diff --git a/service_scan.cc b/service_scan.cc index 9bb02483c..59839ff01 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -2682,6 +2682,7 @@ int service_scan(vector &Targets) { if ((nsp = nsp_new(SG)) == NULL) { fatal("%s() failed to create new nsock pool.", __func__); } + nsp_setdevice(nsp, o.device); if (o.versionTrace()) { nsp_settrace(nsp, NULL, NSOCK_TRACE_LEVEL, o.getStartTime());