Skip to content

Commit 8695c54

Browse files
committed
Take in account ipparse changes
1 parent 8f668a2 commit 8695c54

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

hexdump/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ make xdp.o
4646
## Usage
4747

4848
```sh
49-
sudo lunatik spawn hexdump/hook # runs the Lua kernel script
49+
sudo lunatik start hexdump/hook false # runs the Lua kernel script
5050
sudo xdp-loader load -m skb eth0 xdp.o # if using XDP: replace eth0 by your interface.
5151
sudo journalctl -ft kernel # or use dmesg
5252
sudo xdp-loader unload eth0 --all # unloads the XDP helper

hexdump/hook.moon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DEBUG = true
2-
XDP = true
3-
--NETFILTER = true
2+
XDP = false
3+
NETFILTER = not XDP
44

55
xdp = require"xdp"
66
nf = require"netfilter"
@@ -18,7 +18,7 @@ protocols =
1818
[UDP.protocol_type]: "UDP"
1919

2020
dump = =>
21-
return if not @
21+
return nil if not @
2222
if @is_fragment!
2323
print"Fragment detected: #{@length}" if DEBUG
2424
f_ip = collect @
@@ -27,7 +27,7 @@ dump = =>
2727
@ = f_ip
2828
pkt = UDP(@data)
2929
print"\n\n#{@src} #{pkt.sport} #{@dst} #{pkt.dport} #{protocols[@protocol] or @protocol}\n"
30-
print l for l in *@hexdump
30+
print l for l in @hexdump!
3131

3232
if XDP
3333
PASS = xdp.action.PASS

0 commit comments

Comments
 (0)