Browse Source

Import upstream version 4.2.6

Fred Klassen 3 years ago
parent
commit
dc41c198fc
13 changed files with 54 additions and 32 deletions
  1. 10 10
      configure
  2. 1 1
      configure.ac
  3. 3 0
      docs/CHANGELOG
  4. 8 8
      src/common/get.c
  5. 1 1
      src/common/git_version.c
  6. 1 1
      src/tcpbridge.1
  7. 1 1
      src/tcpcapinfo.1
  8. 24 5
      src/tcpedit/edit_packet.c
  9. 1 1
      src/tcpliveplay.1
  10. 1 1
      src/tcpprep.1
  11. 1 1
      src/tcpreplay-edit.1
  12. 1 1
      src/tcpreplay.1
  13. 1 1
      src/tcprewrite.1

+ 10 - 10
configure

@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tcpreplay 4.2.5.
+# Generated by GNU Autoconf 2.69 for tcpreplay 4.2.6.
 #
 # Report bugs to <https://github.com/appneta/tcpreplay/issues>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tcpreplay'
 PACKAGE_TARNAME='tcpreplay'
-PACKAGE_VERSION='4.2.5'
-PACKAGE_STRING='tcpreplay 4.2.5'
+PACKAGE_VERSION='4.2.6'
+PACKAGE_STRING='tcpreplay 4.2.6'
 PACKAGE_BUGREPORT='https://github.com/appneta/tcpreplay/issues'
 PACKAGE_URL='http://tcpreplay.sourceforge.net/'
 
@@ -1429,7 +1429,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tcpreplay 4.2.5 to adapt to many kinds of systems.
+\`configure' configures tcpreplay 4.2.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1500,7 +1500,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tcpreplay 4.2.5:";;
+     short | recursive ) echo "Configuration of tcpreplay 4.2.6:";;
    esac
   cat <<\_ACEOF
 
@@ -1669,7 +1669,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tcpreplay configure 4.2.5
+tcpreplay configure 4.2.6
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2629,7 +2629,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tcpreplay $as_me 4.2.5, which was
+It was created by tcpreplay $as_me 4.2.6, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3773,7 +3773,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tcpreplay'
- VERSION='4.2.5'
+ VERSION='4.2.6'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -24556,7 +24556,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tcpreplay $as_me 4.2.5, which was
+This file was extended by tcpreplay $as_me 4.2.6, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -24623,7 +24623,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-tcpreplay config.status 4.2.5
+tcpreplay config.status 4.2.6
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

+ 1 - 1
configure.ac

@@ -4,7 +4,7 @@ dnl $Id$
 AC_PREREQ([2.69])
 
 dnl Set version info here!
-AC_INIT([tcpreplay],[4.2.5],
+AC_INIT([tcpreplay],[4.2.6],
     [https://github.com/appneta/tcpreplay/issues],
     [tcpreplay],
     [http://tcpreplay.sourceforge.net/])

+ 3 - 0
docs/CHANGELOG

@@ -1,3 +1,6 @@
+05/10/2017 Version 4.2.6
+    - Test fails on sparc64 (#393)
+
 05/02/2017 Version 4.2.5
     - Fix issues found by scan-build (#384)
     - Improve --portmap help message (#381)

+ 8 - 8
src/common/get.c

@@ -208,9 +208,9 @@ get_l2len(const u_char *pktdata, const int datalen, const int datalink)
 /**
  * \brief returns a ptr to the ipv4 header + data or NULL if it's not IP
  *
- * we may use an extra buffer for the ip header (and above)
- * on stricly aligned systems where the layer 2 header doesn't
- * fall on a 4 byte boundry (like a standard ethernet header)
+ * we may use an extra buffer for the IP header (and above)
+ * on strictly aligned systems where the layer 2 header doesn't
+ * fall on a 4 byte boundary (like a standard Ethernet header)
  *
  * Note: you can cast the result as an ip_hdr_t, but you'll be able 
  * to access data above the header minus any stripped L2 data
@@ -247,7 +247,7 @@ get_ipv4(const u_char *pktdata, int datalen, int datalink, u_char **newbuff)
      * back onto the pkt.data + l2len buffer
      * we do all this work to prevent byte alignment issues
      */
-    if (l2_len % 4) {
+    if (l2_len % sizeof(long)) {
         memcpy(*newbuff, (pktdata + l2_len), (datalen - l2_len));
         ip_hdr = *newbuff;
     } else {
@@ -270,9 +270,9 @@ get_ipv4(const u_char *pktdata, int datalen, int datalink, u_char **newbuff)
 /**
  * \brief returns a ptr to the ipv6 header + data or NULL if it's not IP
  *
- * we may use an extra buffer for the ip header (and above)
- * on stricly aligned systems where the layer 2 header doesn't
- * fall on a 4 byte boundry (like a standard ethernet header)
+ * we may use an extra buffer for the IP header (and above)
+ * on strictly aligned systems where the layer 2 header doesn't
+ * fall on a 4 byte boundary (like a standard Ethernet header)
  *
  * Note: you can cast the result as an ip_hdr_t, but you'll be able 
  * to access data above the header minus any stripped L2 data
@@ -309,7 +309,7 @@ get_ipv6(const u_char *pktdata, int datalen, int datalink, u_char **newbuff)
      * back onto the pkt.data + l2len buffer
      * we do all this work to prevent byte alignment issues
      */
-    if (l2_len % 4) {
+    if (l2_len % sizeof(long)) {
         memcpy(*newbuff, (pktdata + l2_len), (datalen - l2_len));
         ip6_hdr = *newbuff;
     } else {

+ 1 - 1
src/common/git_version.c

@@ -1,4 +1,4 @@
-const char GIT_Version[] = "git:v4.2.5";
+const char GIT_Version[] = "git:v4.2.6";
 const char *git_version(void) {
     return GIT_Version;
 }

+ 1 - 1
src/tcpbridge.1

@@ -10,7 +10,7 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH tcpbridge 1 "08 May 2017" "tcpbridge" "User Commands"
+.TH tcpbridge 1 "16 May 2017" "tcpbridge" "User Commands"
 .\"
 .\" DO NOT EDIT THIS FILE (in-mem file)
 .\"

+ 1 - 1
src/tcpcapinfo.1

@@ -10,7 +10,7 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH tcpcapinfo 1 "08 May 2017" "Tcpreplay Suite" "User Commands"
+.TH tcpcapinfo 1 "16 May 2017" "Tcpreplay Suite" "User Commands"
 .\"
 .\" DO NOT EDIT THIS FILE (in-mem file)
 .\"

+ 24 - 5
src/tcpedit/edit_packet.c

@@ -948,8 +948,11 @@ randomize_iparp(tcpedit_t *tcpedit, struct pcap_pkthdr *pkthdr,
 {
     arp_hdr_t *arp_hdr = NULL;
     int l2len = 0;
-    uint32_t *ip, tempip;
+    uint32_t *ip;
     u_char *add_hdr;
+#ifdef FORCE_ALIGN
+    uint32_t iptemp;
+#endif
 
     assert(tcpedit);
     assert(pkthdr);
@@ -968,14 +971,30 @@ randomize_iparp(tcpedit_t *tcpedit, struct pcap_pkthdr *pkthdr,
         /* jump to the addresses */
         add_hdr = (u_char *)arp_hdr;
         add_hdr += sizeof(arp_hdr_t) + arp_hdr->ar_hln;
+#ifdef FORCE_ALIGN
+        /* copy IP to a temporary buffer for processing */
+        memcpy(&iptemp, add_hdr, sizeof(uint32_t));
+        ip = &iptemp;
+#else
         ip = (uint32_t *)add_hdr;
-        tempip = randomize_ipv4_addr(tcpedit, *ip);
-        memcpy(ip, &tempip, sizeof(uint32_t));
+#endif
+        *ip = randomize_ipv4_addr(tcpedit, *ip);
+#ifdef FORCE_ALIGN
+        memcpy(add_hdr, &iptemp, sizeof(uint32_t));
+#endif
 
         add_hdr += arp_hdr->ar_pln + arp_hdr->ar_hln;
+#ifdef FORCE_ALIGN
+        /* copy IP2 to a temporary buffer for processing */
+        memcpy(&iptemp, add_hdr, sizeof(uint32_t));
+        ip = &iptemp;
+#else
         ip = (uint32_t *)add_hdr;
-        tempip = randomize_ipv4_addr(tcpedit, *ip);
-        memcpy(ip, &tempip, sizeof(uint32_t));
+#endif
+        *ip = randomize_ipv4_addr(tcpedit, *ip);
+#ifdef FORCE_ALIGN
+        memcpy(add_hdr, &iptemp, sizeof(uint32_t));
+#endif
     }
 
     return 1; /* yes we changed the packet */

+ 1 - 1
src/tcpliveplay.1

@@ -10,7 +10,7 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH tcpliveplay 1 "08 May 2017" "tcpliveplay" "User Commands"
+.TH tcpliveplay 1 "16 May 2017" "tcpliveplay" "User Commands"
 .\"
 .\" DO NOT EDIT THIS FILE (in-mem file)
 .\"

+ 1 - 1
src/tcpprep.1

@@ -10,7 +10,7 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH tcpprep 1 "08 May 2017" "tcpprep" "User Commands"
+.TH tcpprep 1 "16 May 2017" "tcpprep" "User Commands"
 .\"
 .\" DO NOT EDIT THIS FILE (in-mem file)
 .\"

+ 1 - 1
src/tcpreplay-edit.1

@@ -10,7 +10,7 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH tcpreplay-edit 1 "08 May 2017" "tcpreplay" "User Commands"
+.TH tcpreplay-edit 1 "16 May 2017" "tcpreplay" "User Commands"
 .\"
 .\" DO NOT EDIT THIS FILE (in-mem file)
 .\"

+ 1 - 1
src/tcpreplay.1

@@ -10,7 +10,7 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH tcpreplay-edit 1 "08 May 2017" "tcpreplay" "User Commands"
+.TH tcpreplay-edit 1 "16 May 2017" "tcpreplay" "User Commands"
 .\"
 .\" DO NOT EDIT THIS FILE (in-mem file)
 .\"

+ 1 - 1
src/tcprewrite.1

@@ -10,7 +10,7 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH tcprewrite 1 "08 May 2017" "tcprewrite" "User Commands"
+.TH tcprewrite 1 "16 May 2017" "tcprewrite" "User Commands"
 .\"
 .\" DO NOT EDIT THIS FILE (in-mem file)
 .\"