summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-07-03 16:53:42 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-07-03 16:53:42 +0200
commitf5c10ae4e3cc56eb0a8662c39442146415cc2df4 (patch)
treede2f6dd1a8aca9d9d62876c748d7bef7796ef888
parent2bcc60885d8dc61d49608cf9125a2432607631b1 (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>
-rw-r--r--dissector.c7
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: