diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-08-29 10:30:15 -0400 |
---|---|---|
committer | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-08-29 15:15:23 +0000 |
commit | 8ddd480eaa4c757edf63a66f068fdf7c64a143b0 (patch) | |
tree | 4a1299ee1f3dc8fb0dabab946043ac90127bd9a5 /wiretap | |
parent | 9158176b7f9a95f2ea701290a39ed53dc70bf834 (diff) |
pcapng: do not byte-swap NRB IPv4 address
Per the spec, it's always encoded in network order (4 separate bytes), and
thus should not be swapped on read.
Bug: 11484
Change-Id: I6a650896b324f42bfd2e05759c84e87ace733372
Reviewed-on: https://code.wireshark.org/review/10304
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/pcapng.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 27645e4929..86945dcf89 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -1760,8 +1760,8 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t */ memcpy(&v4_addr, ws_buffer_start_ptr(&nrb_rec), 4); - if (pn->byte_swapped) - v4_addr = GUINT32_SWAP_LE_BE(v4_addr); + /* IPv4 address is in big-endian order in the file always, which is how we store + it internally as well, so don't byte-swap it */ for (namep = (char *)ws_buffer_start_ptr(&nrb_rec) + 4, record_len = nrb.record_len - 4; record_len != 0; namep += namelen, record_len -= namelen) { |