diff options
-rw-r--r-- | epan/dissectors/packet-erf.c | 1 | ||||
-rw-r--r-- | wiretap/erf.c | 14 | ||||
-rw-r--r-- | wiretap/erf.h | 3 |
3 files changed, 7 insertions, 11 deletions
diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index 39809ec940..f5f7099bb9 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -2481,6 +2481,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) break; default: + call_data_dissector(tvb, pinfo, tree); break; } /* erf type */ return tvb_captured_length(tvb); diff --git a/wiretap/erf.c b/wiretap/erf.c index 04a1bb5be8..e8208be361 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -237,7 +237,7 @@ extern wtap_open_return_val erf_open(wtap *wth, int *err, gchar **err_info) /* number of records to scan before deciding if this really is ERF */ if ((s = getenv("ERF_RECORDS_TO_CHECK")) != NULL) { - if ((n = atoi(s)) > 0 && n < 101) { + if ((n = atoi(s)) >= 0 && n < 101) { records_for_erf_check = n; } } @@ -295,12 +295,12 @@ extern wtap_open_return_val erf_open(wtap *wth, int *err, gchar **err_info) continue; } - /* fail on invalid record type, decreasing timestamps or non-zero pad-bits */ - /* Not all types within this range are decoded, but it is a first filter */ - if ((header.type & 0x7F) == 0 || (header.type & 0x7F) > ERF_TYPE_MAX ) { + /* ERF Type 0 is reserved for ancient legacy records which are not supported, probably not ERF */ + if ((header.type & 0x7F) == 0) { return WTAP_OPEN_NOT_MINE; } + /* fail on decreasing timestamps */ if ((ts = pletoh64(&header.ts)) < prevts) { /* reassembled AALx records may not be in time order, also records are not in strict time order between physical interfaces, so allow 1 sec fudge */ if ( ((prevts-ts)>>32) > 1 ) { @@ -680,10 +680,8 @@ static gboolean erf_read_header(wtap *wth, FILE_T fh, case ERF_TYPE_TCP_FLOW_COUNTER: /* unsupported, continue with default: */ default: - *err = WTAP_ERR_UNSUPPORTED; - *err_info = g_strdup_printf("erf: unknown record encapsulation %u", - erf_header->type); - return FALSE; + /* let the dissector dissect as unknown record type for forwards compatibility */ + break; } { diff --git a/wiretap/erf.h b/wiretap/erf.h index 168f51a275..bf91311025 100644 --- a/wiretap/erf.h +++ b/wiretap/erf.h @@ -95,9 +95,6 @@ /* Pad records */ #define ERF_TYPE_PAD 48 -#define ERF_TYPE_MIN 1 /* sanity checking */ -#define ERF_TYPE_MAX 48 /* sanity checking */ - #define ERF_EXT_HDR_TYPE_CLASSIFICATION 3 #define ERF_EXT_HDR_TYPE_INTERCEPTID 4 #define ERF_EXT_HDR_TYPE_RAW_LINK 5 |