aboutsummaryrefslogtreecommitdiffstats
path: root/text2pcap.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2018-12-15 20:50:13 +0100
committerAnders Broman <a.broman58@gmail.com>2018-12-16 09:33:42 +0000
commit907faa6b98e1497aaa827a09e9e98bde131c4191 (patch)
treee5bbbe61dd505ab1403999d06f80380c3ed76253 /text2pcap.c
parentb71c310203a264769292a502aefe0398f88b6fab (diff)
text2pcap: make IP ID endianess independant
Just as IP addresses the IP ID is also an entity that is endianess sensitive. Select the appropriate value in the same way as the IP addresses. Change-Id: Ib2f07ea7820b443d0bf6e58fdc5afd7fc429fe22 Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-on: https://code.wireshark.org/review/31054 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'text2pcap.c')
-rw-r--r--text2pcap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/text2pcap.c b/text2pcap.c
index 309f4704c6..4d0732329b 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -19,7 +19,7 @@
* This utility reads in an ASCII hexdump of this common format:
*
* 00000000 00 E0 1E A7 05 6F 00 10 5A A0 B9 12 08 00 46 00 .....o..Z.....F.
- * 00000010 03 68 00 00 00 00 0A 2E EE 33 0F 19 08 7F 0F 19 .h.......3.....
+ * 00000010 03 68 00 00 00 00 0A 2E EE 33 0F 19 08 7F 0F 19 .h.......3......
* 00000020 03 80 94 04 00 00 10 01 16 A2 0A 00 03 50 00 0C .............P..
* 00000030 01 01 0F 19 03 80 11 01 1E 61 00 0C 03 01 0F 19 .........a......
*
@@ -196,7 +196,7 @@ static gboolean identify_ascii = FALSE;
static gboolean has_direction = FALSE;
static guint32 direction = 0;
-/*--- Local date -----------------------------------------------------------------*/
+/*--- Local data -----------------------------------------------------------------*/
/* This is where we store the packet currently being built */
static guint8 packet_buf[WTAP_MAX_PACKET_SIZE_STANDARD];
@@ -291,14 +291,16 @@ typedef struct {
/* Fixed IP address values */
#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define IP_ID 0x1234
#define IP_SRC 0x0a010101
#define IP_DST 0x0a020202
#else
+#define IP_ID 0x3412
#define IP_SRC 0x0101010a
#define IP_DST 0x0202020a
#endif
-static hdr_ip_t HDR_IP = {0x45, 0, 0, 0x3412, 0, 0, 0xff, 0, 0, IP_SRC, IP_DST};
+static hdr_ip_t HDR_IP = {0x45, 0, 0, IP_ID, 0, 0, 0xff, 0, 0, IP_SRC, IP_DST};
static struct { /* pseudo header for checksum calculation */
guint32 src_addr;