ERF: Fix broken erf_open ethernet checking

Was copying 8 byte extension header instead of 2 byte ethernet padding subheader.
Introduced recently by I8ede5c733867ccc98ab2d470181d1e4a29ae5b49.

Change-Id: I95a8604ed6204dff33f1794601342e090f6b7eb3
Reviewed-on: https://code.wireshark.org/review/25410
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Anthony Coddington 2018-01-22 17:38:44 +13:00 committed by Alexis La Goutte
parent 6358aadfd6
commit 3e14d3b440
1 changed files with 3 additions and 3 deletions

View File

@ -522,16 +522,16 @@ extern wtap_open_return_val erf_open(wtap *wth, int *err, gchar **err_info)
case ERF_TYPE_COLOR_ETH:
case ERF_TYPE_DSM_COLOR_ETH:
case ERF_TYPE_COLOR_HASH_ETH:
if (!wtap_read_bytes(wth->fh,&eth_hdr,erf_ext_header_size,err,err_info)) {
if (!wtap_read_bytes(wth->fh,&eth_hdr,erf_eth_hdr_size,err,err_info)) {
if (*err == WTAP_ERR_SHORT_READ) {
/* Subheader missing, not an ERF file */
return WTAP_OPEN_NOT_MINE;
}
return WTAP_OPEN_ERROR;
}
if (packet_size < erf_ext_header_size)
if (packet_size < erf_eth_hdr_size)
return WTAP_OPEN_NOT_MINE;
packet_size -= erf_ext_header_size;
packet_size -= erf_eth_hdr_size;
break;
default:
break;