Skip to content

Commit

Permalink
Properly process IPv6 extension headers - copy from 4.0alpha1 for app…
Browse files Browse the repository at this point in the history
  • Loading branch information
fklassen committed Dec 8, 2013
1 parent 91de0b0 commit 893d187
Show file tree
Hide file tree
Showing 18 changed files with 351 additions and 248 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ config.status
libtool
.deps
autom4te.cache
src/config.h
src/defines.h
src/stamp-h1
test/config
compile
config.guess
Expand All @@ -77,4 +74,3 @@ types_c.vim
.project
.cproject
*.1
src/tcpedit/tcpedit_stub.h
2 changes: 1 addition & 1 deletion docs/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $Id$
- Removed sleep-accel option (appneta #2)
- Enhance accuracy and performance of --mbps option (appneta #2)
- Add netmap injector (appneta #1)
- Add --sleepmode option to handle high precision timing (#421)
- Properly process IPv6 extension headers (#396)
- Update URL's to point to new tcpreplay website (#430)
- Improve & fix bugs in tcpcapinfo (#437)
- Fix statistics to be more industry standard (#443)
Expand Down
2 changes: 2 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ flowreplay
tcpbridge
defines.h
config.h
stamp-h1
*_opts.c
tcpedit/tcpedit_stub.h
4 changes: 2 additions & 2 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1294,10 +1294,10 @@ tcprewrite.1: tcprewrite_opts.def tcpedit/tcpedit_opts.def
@AUTOGEN@ -T agman-cmd.tpl $(opts_list) tcprewrite_opts.def || true

tcpreplay-edit.1: tcpreplay_opts.def
@AUTOGEN@ -T agman-cmd.tpl $(opts_list) @NETMAPFLAGS@ -DTCPREPLAY_EDIT -DTCPREPLAY_EDIT_MAN tcpreplay_opts.def || true
@AUTOGEN@ -T agman-cmd.tpl $(opts_list) -DTCPREPLAY_EDIT -DTCPREPLAY_EDIT_MAN tcpreplay_opts.def || true

tcpreplay.1: tcpreplay_opts.def
@AUTOGEN@ -T agman-cmd.tpl $(opts_list) @NETMAPFLAGS@ tcpreplay_opts.def || true
@AUTOGEN@ -T agman-cmd.tpl $(opts_list) tcpreplay_opts.def || true

tcpbridge.1: tcpbridge_opts.def tcpedit/tcpedit_opts.def
@AUTOGEN@ -T agman-cmd.tpl $(opts_list) tcpbridge_opts.def || true
Expand Down
3 changes: 3 additions & 0 deletions src/common.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* $Id$ */

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013 Fred Klassen <fklassen at appneta dot com> - AppNeta Inc.
Expand All @@ -16,6 +18,7 @@
* along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef __COMMON_H__
#define __COMMON_H__
#include <assert.h>
Expand Down
1 change: 0 additions & 1 deletion src/common/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
cmake_install.cmake
git_version.c
2 changes: 1 addition & 1 deletion src/common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ git_version.c:
git describe --always --abbrev=0 | tr -d '\n' | tr -d '\r' >> git_version.c
$(ECHO) '";' >> git_version.c
$(ECHO) 'const char *git_version(void) {' >> git_version.c
$(ECHO) ' return GIT_Version;' >> git_version.c
$(ECHO) ' return GIT_Version;' >> git_version.c
$(ECHO) '}' >> git_version.c

libcommon_a_SOURCES = cidr.c err.c list.c cache.c services.c get.c \
Expand Down
2 changes: 1 addition & 1 deletion src/common/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ git_version.c:
git describe --always --abbrev=0 | tr -d '\n' | tr -d '\r' >> git_version.c
$(ECHO) '";' >> git_version.c
$(ECHO) 'const char *git_version(void) {' >> git_version.c
$(ECHO) ' return GIT_Version;' >> git_version.c
$(ECHO) ' return GIT_Version;' >> git_version.c
$(ECHO) '}' >> git_version.c

# Tell versions [3.59,3.63) of GNU make to not export all variables.
Expand Down
6 changes: 3 additions & 3 deletions src/common/cidr.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ ip_in_cidr(const tcpr_cidr_t * mycidr, const unsigned long ip)

#ifdef DEBUG
/* copy this for debug purposes, since it's not re-entrant */
strlcpy(netstr, get_addr2name4(mycidr->u.network, RESOLVE), 20);
strlcpy(netstr, get_addr2name4(htonl(mycidr->u.network), RESOLVE), 20);
#endif

/* if they're the same, then ip is in network */
Expand Down Expand Up @@ -670,7 +670,7 @@ cidr2iplist(tcpr_cidr_t * cidr, char delim)
for (i = 2; i <= (32 - cidr->masklen); i++)
numips *= 2;

size = 16 * numips;
size = 17 * numips - 1;

list = (char *)safe_malloc(size);

Expand All @@ -693,7 +693,7 @@ cidr2iplist(tcpr_cidr_t * cidr, char delim)

/* last is a special case, end in \0 */
in.s_addr = htonl(addr);
snprintf(ipaddr, 16, "%s", inet_ntoa(in));
snprintf(ipaddr, 17, "%s", inet_ntoa(in));
strlcat(list, ipaddr, size);

return list;
Expand Down
Loading

0 comments on commit 893d187

Please sign in to comment.