mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 09:49:05 +00:00
Return -1 instead of calling pfatal in nmap_raw_socket.
There was one case where we previously didn't fatal, in nse_dnet.cc. Move the fatal calls out of nmap_raw_socket and into the calling scope, with the exception of the one in nse_dnet.cc. The problem was reported by Rob Nicholls. http://seclists.org/nmap-dev/2012/q4/186
This commit is contained in:
5
tcpip.cc
5
tcpip.cc
@@ -155,8 +155,9 @@ int nmap_raw_socket(const char *warning_device_name) {
|
||||
#ifdef WIN32
|
||||
win32_fatal_raw_sockets(warning_device_name);
|
||||
#endif
|
||||
if ((rawsd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0 )
|
||||
pfatal("socket troubles in %s", __func__);
|
||||
rawsd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
|
||||
if (rawsd < 0)
|
||||
return rawsd;
|
||||
broadcast_socket(rawsd);
|
||||
#ifndef WIN32
|
||||
sethdrinclude(rawsd);
|
||||
|
||||
Reference in New Issue
Block a user