1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Check return value of eth_send in case of errors

This commit is contained in:
dmiller
2022-01-13 22:30:20 +00:00
parent 044295b0c8
commit a0b2d3d80e

View File

@@ -206,8 +206,11 @@ static int ethernet_send (lua_State *L)
log_write(LOG_STDOUT, "%s: Ethernet frame (%lu bytes) > %s\n", log_write(LOG_STDOUT, "%s: Ethernet frame (%lu bytes) > %s\n",
SCRIPT_ENGINE, len, udata->devname); SCRIPT_ENGINE, len, udata->devname);
} }
eth_send(udata->eth, frame, len); size_t sent = eth_send(udata->eth, frame, len);
return nseU_success(L); if (sent == len)
return nseU_success(L);
else
return nseU_safeerror(L, "eth_send error: %lu", sent);
} }
static int ip_open (lua_State *L) static int ip_open (lua_State *L)