diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-07-03 16:53:42 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-07-03 16:53:42 +0200 |
commit | f5c10ae4e3cc56eb0a8662c39442146415cc2df4 (patch) | |
tree | de2f6dd1a8aca9d9d62876c748d7bef7796ef888 /dissector.c | |
parent | 2bcc60885d8dc61d49608cf9125a2432607631b1 (diff) |
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 <dborkman@redhat.com>
Diffstat (limited to 'dissector.c')
-rw-r--r-- | dissector.c | 7 |
1 files changed, 5 insertions, 2 deletions
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: |