diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-12-28 20:58:38 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-12-29 04:59:13 +0000 |
commit | 9bf40d4a6e507e10c8429a758ac190146caf48d6 (patch) | |
tree | 0f9abc28c501dd41e785bf92855281b2718e18f5 /wiretap/file_access.c | |
parent | c5dbcca2e4f3613f04e74715269c611dbb5259d1 (diff) |
Do the right check for "no name resolution information to save".
The check that the pcapng code does is "do we have a non-null
addrinfo_lists_t * and, if so, does it have a non-null ipv4_addr_list or
ipv6_addr_list"?
The check that the file-save code was using was just "do we have a
non-null addrinfo_lists_t *", so sometimes it'd think we couldn't do a
"quick save" even though we had no name resolution information to write
out to the capture file.
Make a routine that does that check, and use it in *both* places.
Change-Id: Id4720f4fe4940354320b2b7621ca5e37e45ec1f3
Reviewed-on: https://code.wireshark.org/review/25055
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r-- | wiretap/file_access.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 8740756df2..307fa17e55 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -2608,6 +2608,14 @@ wtap_set_bytes_dumped(wtap_dumper *wdh, gint64 bytes_dumped) } gboolean +wtap_addrinfo_list_empty(addrinfo_lists_t *addrinfo_lists) +{ + return (addrinfo_lists == NULL) || + ((addrinfo_lists->ipv4_addr_list == NULL) && + (addrinfo_lists->ipv6_addr_list == NULL)); +} + +gboolean wtap_dump_set_addrinfo_list(wtap_dumper *wdh, addrinfo_lists_t *addrinfo_lists) { if (!wdh || wdh->file_type_subtype < 0 || wdh->file_type_subtype >= wtap_num_file_types_subtypes |