summaryrefslogtreecommitdiff
path: root/dissector.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-07-10 16:30:03 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-07-10 16:30:03 +0200
commitfce8544c7e93b1001784e7e3607f4ef0eae56bee (patch)
tree7bd875d53e42bbba4bbc5a070e7c486c63e7a363 /dissector.c
parent2a646423bd0cab7017bbe1ad4911dc672a230160 (diff)
dissector: print hex_ascii combination in unkown linktypes
Commit f5c10ae4e3 ("dissector: do not panic on unknown hatype") let netsniff-ng not panic anymore on unkown ha types, but without explicitly starting netsniff-ng in hex or ascii printing mode, no dissection will happen. This patch fixes this situation so that at least ascii_hex() will be called in case the link type is not known to us. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'dissector.c')
-rw-r--r--dissector.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/dissector.c b/dissector.c
index 8662424..549ce1e 100644
--- a/dissector.c
+++ b/dissector.c
@@ -61,9 +61,8 @@ 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;
+ struct pkt_buff *pkt;
if (mode == PRINT_NONE)
return;
@@ -82,12 +81,12 @@ void dissector_entry_point(uint8_t *packet, size_t len, int linktype, int mode)
proto_end = dissector_get_ieee80211_exit_point();
break;
default:
- skip_dissecting = true;
+ proto_start = &none_ops;
+ proto_end = NULL;
break;
};
- if (!skip_dissecting)
- dissector_main(pkt, proto_start, proto_end);
+ dissector_main(pkt, proto_start, proto_end);
switch (mode) {
case PRINT_HEX: