diff options
author | Guy Harris <gharris@sonic.net> | 2021-06-18 15:34:49 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-06-18 22:53:24 +0000 |
commit | 930d8f763cb3b5580c691981752f3fa536f7e136 (patch) | |
tree | 9645f3e16c5fff4217905c4e8eda0816c9e12b6e | |
parent | 4a34fa38f18fb01fdb2b5f0469d5261c49659f57 (diff) |
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 d69d1271f08fb4e919447dbfb8a36c2cdfe3e48b)
-rw-r--r-- | wiretap/libpcap.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index a5ce1303ef..5b7709713f 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -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; } |