mirror of
https://github.com/nmap/nmap.git
synced 2026-06-24 10:12:22 +00:00
Call socket_bindtodevice in nmap_raw_socket.
This commit is contained in:
parent
6ec453e4e8
commit
84f4697c50
1 changed files with 4 additions and 1 deletions
5
tcpip.cc
5
tcpip.cc
|
|
@ -142,11 +142,13 @@ static PacketCounter PktCt;
|
|||
* Emit a fatal error on Windows.
|
||||
* Set SO_BROADCAST.
|
||||
* Set IP_HDRINCL.
|
||||
* Bind to an interface with SO_BINDTODEVICE (if o.device is set).
|
||||
The socket is created with address family AF_INET, but may be usable for
|
||||
AF_INET6, depending on the operating system.
|
||||
|
||||
The argument warning_device_name is used *only* in the Windows fatal error
|
||||
message, and does not affect any socket characteristics. */
|
||||
message, and does not affect any socket characteristics. The global o.device
|
||||
controls which interface to bind to with SO_BINDTODEVICE. */
|
||||
int nmap_raw_socket(const char *warning_device_name) {
|
||||
int rawsd;
|
||||
|
||||
|
|
@ -159,6 +161,7 @@ int nmap_raw_socket(const char *warning_device_name) {
|
|||
#ifndef WIN32
|
||||
sethdrinclude(rawsd);
|
||||
#endif
|
||||
socket_bindtodevice(rawsd, o.device);
|
||||
|
||||
return rawsd;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue