Permalink
Browse files

sniff: accept any link type (fake ethernet header)

For now, throw away the link type header except for ethernet. Tested
with DLT_NULL and DLT_LINUX_SLL.
  • Loading branch information...
msantos committed Mar 9, 2011
1 parent 104ca59 commit 3fea68f9d5cc7f8b2f68734ce8e841d51a7792f9
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/sniff.erl
View
@@ -215,8 +215,7 @@ tcp_flags(#tcp{cwr = CWR, ece = ECE, urg = URG, ack = ACK,
decode(ether, Packet) ->
pkt:decapsulate({ether, Packet});
-decode(null, Packet) ->
+decode(DLT, Packet) ->
% Add a fake ethernet header
- [_Null, IP, Hdr, Payload] = pkt:decapsulate({null, Packet}),
+ [_Linktype, IP, Hdr, Payload] = pkt:decapsulate({DLT, Packet}),
[#ether{}, IP, Hdr, Payload].
-

0 comments on commit 3fea68f

Please sign in to comment.