mirror of
https://github.com/nmap/nmap.git
synced 2026-01-20 05:09:02 +00:00
Fix nse_dnet.cc compilation on Windows. This was broken in the merge in r20267.
This commit is contained in:
@@ -182,7 +182,7 @@ static int ip_send (lua_State *L)
|
||||
{
|
||||
nse_dnet_udata *udata = (nse_dnet_udata *) luaL_checkudata(L, 1, DNET_METATABLE);
|
||||
const char *packet = luaL_checkstring(L, 2);
|
||||
|
||||
char dev[16];
|
||||
int ret;
|
||||
|
||||
if (udata->sock == -1)
|
||||
@@ -191,6 +191,8 @@ static int ip_send (lua_State *L)
|
||||
if (lua_objlen(L, 2) < sizeof(struct ip))
|
||||
return luaL_error(L, "ip packet too short");
|
||||
|
||||
*dev = '\0';
|
||||
|
||||
if (o.sendpref & PACKET_SEND_ETH)
|
||||
{
|
||||
struct route_nfo route;
|
||||
@@ -209,6 +211,8 @@ static int ip_send (lua_State *L)
|
||||
if (!nmap_route_dst(&dstss, &route))
|
||||
goto usesock;
|
||||
|
||||
Strncpy(dev, route.ii.devname, sizeof(dev));
|
||||
|
||||
if (route.ii.device_type != devt_ethernet)
|
||||
goto usesock;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user