summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2009-11-11 21:50:20 -0800
committerSam Roberts <vieuxtech@gmail.com>2009-11-11 21:50:20 -0800
commit30b50e6d7d2fe01c03e9f652d8333061fbb602da (patch)
tree8391390c4c9a17be76e5bc00b4704abd5ef018a6 /lua
parent5c0c799f5236ed622dfc97e5fead9bc1d0f1322d (diff)
downloadlibnet-30b50e6d7d2fe01c03e9f652d8333061fbb602da.tar.gz
Was adding options only if there was payload, caught by unit tests.
Diffstat (limited to 'lua')
-rw-r--r--lua/net.c12
1 files changed, 11 insertions, 1 deletions
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);