mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Call socket_bindtodevice for -sT scan.
This commit is contained in:
parent
84f4697c50
commit
c5faae4b26
1 changed files with 10 additions and 1 deletions
|
|
@ -2978,7 +2978,8 @@ static void ultrascan_port_probe_update(UltraScanInfo *USI, HostScanStats *hss,
|
|||
|
||||
|
||||
/* Set the socket lingering so we will RST connections instead of wasting
|
||||
bandwidth with the four-step close. Set the source address if needed. */
|
||||
bandwidth with the four-step close. Set the source address if needed. Bind to
|
||||
a specific interface if needed. */
|
||||
static void init_socket(int sd) {
|
||||
static int bind_failed = 0;
|
||||
struct linger l;
|
||||
|
|
@ -3000,6 +3001,14 @@ static void init_socket(int sd) {
|
|||
bind_failed = 1;
|
||||
}
|
||||
}
|
||||
errno = 0;
|
||||
if (!socket_bindtodevice(sd, o.device)) {
|
||||
/* EPERM is expected when not running as root. */
|
||||
if (errno != EPERM) {
|
||||
error("Problem binding to interface %s, errno: %d", o.device, socket_errno());
|
||||
perror("socket_bindtodevice");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If this is NOT a ping probe, set pingseq to 0. Otherwise it will be the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue