From 30b50e6d7d2fe01c03e9f652d8333061fbb602da Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Wed, 11 Nov 2009 21:50:20 -0800 Subject: Was adding options only if there was payload, caught by unit tests. --- lua/net.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lua/net.c b/lua/net.c index 68d85b3..e466695 100644 --- a/lua/net.c +++ b/lua/net.c @@ -240,6 +240,16 @@ static int lnet_dump(lua_State* L) return 1; } +#ifdef NET_DUMP +/* Call from inside gdb to see current state of libnet stack */ +void dump(lua_State* L) { + lnet_dump(L); + printf("%s\n", lua_tostring(L, -1)); + lua_pop(L, 1); +} +#endif + + /*- - net = net:clear() @@ -553,7 +563,7 @@ static int lnet_ipv4 (lua_State *L) * - has final ip options bloc, or not */ - if(!payload) { + if(!options) { libnet_pblock_delete(ud, oblock); } else { options_ptag = libnet_build_ipv4_options(options, optionsz, ud, options_ptag); -- cgit v1.2.1