From f5c10ae4e3cc56eb0a8662c39442146415cc2df4 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Wed, 3 Jul 2013 16:53:42 +0200 Subject: dissector: do not panic on unknown hatype Do not panic on linktypes that are unknown to us. Just skip the usual dissector entry point and based on user input, print in hex, ascii, or hex + ascii. Signed-off-by: Daniel Borkmann --- dissector.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'dissector.c') diff --git a/dissector.c b/dissector.c index 167d946..8662424 100644 --- a/dissector.c +++ b/dissector.c @@ -61,6 +61,7 @@ static void dissector_main(struct pkt_buff *pkt, struct protocol *start, void dissector_entry_point(uint8_t *packet, size_t len, int linktype, int mode) { + bool skip_dissecting = false; struct protocol *proto_start, *proto_end; struct pkt_buff *pkt = NULL; @@ -81,10 +82,12 @@ void dissector_entry_point(uint8_t *packet, size_t len, int linktype, int mode) proto_end = dissector_get_ieee80211_exit_point(); break; default: - panic("Linktype not supported!\n"); + skip_dissecting = true; + break; }; - dissector_main(pkt, proto_start, proto_end); + if (!skip_dissecting) + dissector_main(pkt, proto_start, proto_end); switch (mode) { case PRINT_HEX: -- cgit v1.2.3-54-g00ecf