Skip to content

Commit

Permalink
Merge pull request #698 from appneta/Bug_#695_macOS_tests_fail
Browse files Browse the repository at this point in the history
Bug #695 mac os tests fail
  • Loading branch information
fklassen authored Jan 28, 2022
2 parents 54fe0bb + 2500a21 commit 22cecbb
Show file tree
Hide file tree
Showing 198 changed files with 151 additions and 335 deletions.
67 changes: 1 addition & 66 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dnl $Id$
AC_PREREQ([2.69])

dnl Set version info here!
AC_INIT([tcpreplay],[4.4.0-beta1],[https:/appneta/tcpreplay/issues],[tcpreplay],[http://tcpreplay.sourceforge.net/])
AC_INIT([tcpreplay],[4.4.0-beta2],[https:/appneta/tcpreplay/issues],[tcpreplay],[http://tcpreplay.sourceforge.net/])
AC_CONFIG_SRCDIR([src/tcpreplay.c])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_AUX_DIR(config)
Expand Down Expand Up @@ -1699,71 +1699,6 @@ fi

fi # checking pcapnav version


dnl (shamelessly ripped off from libpcap)
dnl Checks to see if unaligned memory accesses fail
dnl
dnl FORCE_ALIGN (DEFINED)
dnl
AC_MSG_CHECKING(for requires strict byte alignment)
AC_CACHE_VAL(unaligned_cv_fail,
[case "$host_cpu" in
# XXX: should also check that they don't do weird things (like on arm)
alpha*|arm*|hp*|mips*|sparc*|ia64)
unaligned_cv_fail=yes
;;
*)
cat >conftest.c <<EOF
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
main() {
unsigned int i;
pid_t pid;
int status;
/* avoid "core dumped" message */
pid = fork();
if (pid < 0)
exit(2);
if (pid > 0) {
/* parent */
pid = waitpid(pid, &status, 0);
if (pid < 0)
exit(3);
exit(!WIFEXITED(status));
}
/* child */
i = *(unsigned int *)&a[[1]];
printf("%d\n", i);
exit(0);
}
EOF
${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
conftest.c $LIBS >/dev/null 2>&1
if test ! -x conftest ; then
dnl failed to compile for some reason
unaligned_cv_fail=yes
else
./conftest >conftest.out
if test ! -s conftest.out ; then
unaligned_cv_fail=yes
else
unaligned_cv_fail=no
fi
fi
rm -f conftest* core core.conftest
;;
esac
])
AC_MSG_RESULT($unaligned_cv_fail)
if test $unaligned_cv_fail = yes ; then
AC_DEFINE([FORCE_ALIGN], [1], [Are we strictly aligned?])
fi

dnl ##################################################
dnl # Check for tcpdump.
dnl ##################################################
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
06/19/2021 Version 4.4.0-beta2
- remove obsolete FORCE_ALIGN support to fix macOS 11 compile (#695)
- add a security policy document (#689)
- ability to specify directory of pcap files (#682)
- incorrect PPS rate for long-running sessions (#679)
Expand Down
2 changes: 1 addition & 1 deletion lib/strlcpy.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/cidr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/cidr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/err.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Copyright (c) 2001-2010 Aaron Turner.
*
* Copyright (c) 2013-2018 Fred Klassen - AppNeta
* Copyright (c) 2013-2022 Fred Klassen - AppNeta
*
* Copyright (c) 2000 Dug Song <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/common/err.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Copyright (c) 2001-2010 Aaron Turner.
*
* Copyright (c) 2013-2018 Fred Klassen - AppNeta
* Copyright (c) 2013-2022 Fred Klassen - AppNeta
*
* Copyright (c) 2000 Dug Song <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/common/fakepcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/fakepcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/fakepcapnav.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/fakepcapnav.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/flows.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/flows.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
38 changes: 1 addition & 37 deletions src/common/get.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -460,29 +460,11 @@ get_ipv4(const u_char *pktdata, int datalen, int datalink, u_char **newbuff)
l2len -= l2offset;
pkt_len -= l2offset;

#ifdef FORCE_ALIGN
/*
* copy layer 3 and up to our temp packet buffer
* for now on, we have to edit the packetbuff because
* just before we send the packet, we copy the packetbuff
* back onto the pkt.data + l2len buffer
* we do all this work to prevent byte alignment issues
*/
if (l2len % sizeof(long)) {
memcpy(*newbuff, (packet + l2len), (pkt_len - l2len));
ip_hdr = *newbuff;
} else {

/* we don't have to do a memcpy if l2len lands on a boundary */
ip_hdr = (packet + l2len);
}
#else
/*
* on non-strict byte align systems, don't need to memcpy(),
* just point to l2len bytes into the existing buffer
*/
ip_hdr = (packet + l2len);
#endif

return ip_hdr;
}
Expand Down Expand Up @@ -535,29 +517,11 @@ get_ipv6(const u_char *pktdata, int datalen, int datalink, u_char **newbuff)
l2len -= l2offset;
pkt_len -= l2offset;

#ifdef FORCE_ALIGN
/*
* copy layer 3 and up to our temp packet buffer
* for now on, we have to edit the packetbuff because
* just before we send the packet, we copy the packetbuff
* back onto the pkt.data + l2len buffer
* we do all this work to prevent byte alignment issues
*/
if (l2len % sizeof(long)) {
memcpy(*newbuff, (packet + l2len), (pkt_len - l2len));
ip6_hdr = *newbuff;
} else {

/* we don't have to do a memcpy if l2len lands on a boundary */
ip6_hdr = (packet + l2len);
}
#else
/*
* on non-strict byte align systems, don't need to memcpy(),
* just point to l2len bytes into the existing buffer
*/
ip6_hdr = (packet + l2len);
#endif

return ip6_hdr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/get.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/list.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/pcap_dlt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/sendpacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/sendpacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/common/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
* Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
* Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
*
* The Tcpreplay Suite of tools is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
Expand Down
Loading

0 comments on commit 22cecbb

Please sign in to comment.