diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-06-15 12:27:21 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-06-15 12:27:21 +0000 |
commit | 665b95d15468761a577420593c017824d57f16c1 (patch) | |
tree | 47ac32c67af7a8912e4c08d227f0619970a50044 /editcap.c | |
parent | cf28e12ed78d25d4b03c13c165f3a5935566c4f9 (diff) | |
download | wireshark-665b95d15468761a577420593c017824d57f16c1.tar.gz |
Try to fix pcap-ng - most files created by editcap -c have no IDB
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7350
By using wtap_dump_open_ng() in all places.
svn path=/trunk/; revision=43271
Diffstat (limited to 'editcap.c')
-rw-r--r-- | editcap.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -1161,9 +1161,6 @@ main(int argc, char *argv[]) wtap_strerror(err)); exit(2); } - - g_free(idb_inf); - idb_inf = NULL; } g_assert(filename); @@ -1187,9 +1184,9 @@ main(int argc, char *argv[]) fprintf(stderr, "Continuing writing in file %s\n", filename); } - pdh = wtap_dump_open(filename, out_file_type, out_frame_type, + pdh = wtap_dump_open_ng(filename, out_file_type, out_frame_type, snaplen ? MIN(snaplen, wtap_snapshot_length(wth)) : wtap_snapshot_length(wth), - FALSE /* compressed */, &err); + FALSE /* compressed */, shb_hdr, idb_inf, &err); if (pdh == NULL) { fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename, @@ -1218,9 +1215,9 @@ main(int argc, char *argv[]) fprintf(stderr, "Continuing writing in file %s\n", filename); } - pdh = wtap_dump_open(filename, out_file_type, out_frame_type, + pdh = wtap_dump_open_ng(filename, out_file_type, out_frame_type, snaplen ? MIN(snaplen, wtap_snapshot_length(wth)) : wtap_snapshot_length(wth), - FALSE /* compressed */, &err); + FALSE /* compressed */, shb_hdr, idb_inf, &err); if (pdh == NULL) { fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename, wtap_strerror(err)); @@ -1485,6 +1482,7 @@ main(int argc, char *argv[]) count++; } + g_free(fprefix); g_free(fsuffix); @@ -1509,9 +1507,9 @@ main(int argc, char *argv[]) g_free (filename); filename = g_strdup(argv[optind+1]); - pdh = wtap_dump_open(filename, out_file_type, out_frame_type, + pdh = wtap_dump_open_ng(filename, out_file_type, out_frame_type, snaplen ? MIN(snaplen, wtap_snapshot_length(wth)): wtap_snapshot_length(wth), - FALSE /* compressed */, &err); + FALSE /* compressed */, shb_hdr, idb_inf, &err); if (pdh == NULL) { fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename, wtap_strerror(err)); @@ -1519,6 +1517,9 @@ main(int argc, char *argv[]) } } + g_free(idb_inf); + idb_inf = NULL; + if (!wtap_dump_close(pdh, &err)) { fprintf(stderr, "editcap: Error writing to %s: %s\n", filename, |