mirror of
https://github.com/nmap/nmap.git
synced 2025-12-29 19:09:01 +00:00
enable --ttl support for connect() scans
This commit is contained in:
10
tcpip.cc
10
tcpip.cc
@@ -161,6 +161,16 @@ setsockopt(sd, IPPROTO_IP, IP_HDRINCL, (const char *) &one, sizeof(one));
|
||||
#endif
|
||||
}
|
||||
|
||||
void set_ttl(int sd, int ttl)
|
||||
{
|
||||
#ifdef IP_TTL
|
||||
if (sd == -1)
|
||||
return;
|
||||
|
||||
setsockopt(sd, IPPROTO_IP, IP_TTL, &ttl, sizeof ttl);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Takes a protocol number like IPPROTO_TCP, IPPROTO_UDP, or
|
||||
// IPPROTO_IP and returns a ascii representation (or "unknown" if it
|
||||
// doesn't recognize the number). If uppercase is true, the returned
|
||||
|
||||
Reference in New Issue
Block a user