libpcap: don't generate a fake interface for LINKTYPE_ERF files.

The ERF code will generate interfaces based on the ERF records in the
file, so don't bother adding an additional dummy interface.


(cherry picked from commit d69d1271f0)
This commit is contained in:
Guy Harris 2021-06-18 15:34:49 -07:00
parent 4a34fa38f1
commit 930d8f763c
1 changed files with 8 additions and 17 deletions

View File

@ -529,25 +529,16 @@ done:
if (wth->file_encap == WTAP_ENCAP_ERF) {
/*Reset the ERF interface lookup table*/
libpcap->encap_priv = erf_priv_create();
} else {
/*
* Add an IDB; we don't know how many interfaces were
* involved, so we just say one interface, about which
* we only know the link-layer type, snapshot length,
* and time stamp resolution.
*/
wtap_add_generated_idb(wth);
}
/*
* Add an IDB; we don't know how many interfaces were involved,
* so we just say one interface, about which we only know
* the link-layer type, snapshot length, and time stamp
* resolution.
*
* XXX - this will be a bit weird if you're trying to convert
* a LINKTYPE_ERF pcap file to a pcapng file; it'll have a
* placeholder interface added here, *plus* interfaces
* added from the ERF records. Ideally, at some point in
* the future, libpcap will have a more pcapng-friendly API
* for capturing, and the DAG capture code will use it, so that
* if you're capturing on more than one interface, they'll all
* get regular IDBs, with no need for the placeholder.
*/
wtap_add_generated_idb(wth);
return WTAP_OPEN_MINE;
}