mirror of
https://github.com/nmap/nmap.git
synced 2026-02-07 05:56:34 +00:00
Factor out an nmap_raw_socket function.
This does the common setup of a raw socket that we use everywhere.
This commit is contained in:
10
idle_scan.cc
10
idle_scan.cc
@@ -382,16 +382,8 @@ static void initialize_idleproxy(struct idle_proxy_info *proxy, char *proxyName,
|
||||
proxy->rawsd = -1;
|
||||
proxy->ethptr = &proxy->eth;
|
||||
} else {
|
||||
#ifdef WIN32
|
||||
win32_fatal_raw_sockets(proxy->host.deviceName());
|
||||
#endif
|
||||
if ((proxy->rawsd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
|
||||
pfatal("socket troubles in %s", __func__);
|
||||
proxy->rawsd = nmap_raw_socket(proxy->host.deviceName());
|
||||
unblock_socket(proxy->rawsd);
|
||||
broadcast_socket(proxy->rawsd);
|
||||
#ifndef WIN32
|
||||
sethdrinclude(proxy->rawsd);
|
||||
#endif
|
||||
proxy->eth.ethsd = NULL;
|
||||
proxy->ethptr = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user