aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2008-02-20 18:02:03 +0000
committerGerald Combs <gerald@wireshark.org>2008-02-20 18:02:03 +0000
commit022a248f4c141b06d90f7c5b02f78eb42bcf7d59 (patch)
tree871d743d9b7775c6fc8e3e4a2a9db7989e7bdc1a /rawshark.c
parent9f522c8eaf75e7ceb056c2e3b5ad964453556ba6 (diff)
Convert any supplied encapsulation from libpcap to wiretap so that DLTs other
than Ethernet work. svn path=/trunk/; revision=24403
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/rawshark.c b/rawshark.c
index 8cba1395b9..212482ea08 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -101,6 +101,9 @@
#include "epan/proto.h"
#include <epan/tap.h>
+#include <wtap.h>
+#include <libpcap.h>
+
#ifdef HAVE_LIBPCAP
#include <pcap.h>
#include <setjmp.h>
@@ -385,7 +388,10 @@ set_link_type(const char *lt_arg) {
#endif
dlt_val = strtol(spec_ptr, NULL, 10);
if (errno != EINVAL && dlt_val >= 0) {
- encap = dlt_val;
+ encap = wtap_pcap_encap_to_wtap_encap(dlt_val);
+ if (encap == WTAP_ENCAP_UNKNOWN) {
+ return FALSE;
+ }
return TRUE;
}
} else if (strncmp(lt_arg, "proto:", strlen("proto:")) == 0) {