appneta / tcpreplay

Pcap editing and replay tools for *NIX and Windows - Users please download source from
http://tcpreplay.appneta.com/wiki/installation.html#downloads
1.17k stars 268 forks source link

tcpbridge does not seem to work with PF_RING's libpcap #104

Closed morphyno closed 10 years ago

morphyno commented 10 years ago

Hi:

I have downloaded 4.0.4 with the latest PF_RING changes from the repo on configure and configure.a (patch #88 )

My goal is to compile and tcpbridge using the libpcap included in the PF_RING distribution.

I was able to configure and make tcpreplay and tools using the following configure line

./configure --with-libpcap=/home/devuser/Documents/PF_RING/userland/libpcap-1.1.1-ring/ --with-tcpdump=/home/devuser/Documents/PF_RING/userland/tcpdump-4.1.1 --with-libdnet=/usr/local/lib/

However, when I attempted to run tcpbridge, I get the following error

sudo src/tcpbridge -i eth1 -I eth3 -u Warning: Unable to get MAC address: Error: sendpacket_get_hwaddr() not yet supported for pcap injection

Fatal Error: Please consult the man page for using the -M option.

If i compile tcpreplay with standard libpcap, I don't have this issue.

Would this be a PF_RING or a tcpreplay bug?

fklassen commented 10 years ago

I'll have a look. If it is a PF_RING issue I'll report it to Luca Deri.

fklassen commented 10 years ago

I cannot understand why this didn't work. Can you send me the failing config.log?

morphyno commented 10 years ago

Hi Fred:

I have attached the config.log and configure stdout.

I'm using tcpreplay 4.0.4 but with the git repo's latest "configure" and " configure.ac"

Thanks

On Sun, Jul 27, 2014 at 4:41 PM, Fred Klassen notifications@github.com wrote:

I cannot understand why this didn't work. Can you send me the failing config.log?

— Reply to this email directly or view it on GitHub https://github.com/appneta/tcpreplay/issues/104#issuecomment-50289842.

All in a can, just add water and stir goodness [devusr@UTraffic9 tcpreplay-4.0.4-newconfig]$ ./configure --with-libpcap=/home/devusr/Documents/PF_RING/userland/libpcap --with-tcpdump=/home/devusr/Documents/PF_RING/userland/tcpdump-4.1.1/ checking whether to enable maintainer-specific portions of Makefiles... no checking if malloc debugging is wanted... no checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for cygwin development environment... no checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1966080 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for ar... ar checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking whether gcc and cc understand -c and -o together... yes checking for gcc option to accept ISO C99... none needed checking for gcc option to accept ISO Standard C... (cached) none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking whether we are using the GNU C++ compiler... (cached) yes checking whether g++ accepts -g... (cached) yes checking dependency style of g++... (cached) gcc3 checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... no checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking how to run the C preprocessor... gcc -E checking whether ln -s works... yes checking for gawk... (cached) gawk checking for a sed that does not truncate output... (cached) /bin/sed checking whether make sets $(MAKE)... (cached) yes checking for printf... /usr/bin/printf checking for echo... /bin/echo checking for cut... /bin/cut checking for autogen... no checking for groff... /usr/bin/groff configure: Using system libopts checking for ANSI C header files... (cached) yes checking whether sys/types.h defines makedev... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no checking for _LARGEFILE_SOURCE value needed for large files... no checking for u_int8_t... yes checking for u_int16_t... yes checking for u_int32_t... yes checking for u_int64_t... yes checking for gcc -Wextra support... no checking for gcc -Wno-variadic-macros support... yes checking for gcc -Wfatal-errors support... yes checking for gcc -Wno-format-contains-nul support... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking for sys/types.h... (cached) yes checking for stdint.h... (cached) yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking netinet/in_systm.h usability... yes checking netinet/in_systm.h presence... yes checking for netinet/in_systm.h... yes checking poll.h usability... yes checking poll.h presence... yes checking for poll.h... yes checking sys/poll.h usability... yes checking sys/poll.h presence... yes checking for sys/poll.h... yes checking for unistd.h... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking for inttypes.h... (cached) yes checking for sys/sysctl.h... yes checking for net/route.h... yes checking for socket in -lsocket... no checking for gethostbyname in -lnsl... yes checking for nanosleep in -lrt... yes checking for resolv in -lresolv... no checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for working memcmp... yes checking return type of signal handlers... void checking for vprintf... yes checking for _doprnt... no checking for struct timeval.tv_sec... yes checking for gettimeofday... yes checking for ctime... yes checking for memset... yes checking for regcomp... yes checking for strdup... yes checking for strchr... yes checking for strerror... yes checking for strtol... yes checking for strncpy... yes checking for strtoull... yes checking for poll... yes checking for ntohll... no checking for mmap... yes checking for snprintf... yes checking for vsnprintf... yes checking for strsignal... yes checking for strlcpy... no checking whether byte ordering is bigendian... no configure: Using u_int64_t for packet counters checking for inet_aton... yes checking for inet_pton... yes checking for inet_ntop... yes checking for inet_addr... yes checking for libpcap... /home/devusr/Documents/PF_RING/userland/libpcap checking for library containing nl_handle_alloc... no checking for numa_available in -lnuma... yes checking for pthread_create in -lpthread... yes checking for library containing pcap_get_pfring_id... no checking for library containing pcap_close... no configure: error: Unable to link libpcap in /home/devusr/Documents/PF_RING/userland/libpcap

morphyno commented 10 years ago

It seems to work fine when I cloned it from git hub. The problem is, my development system is centOS 6.5. There's just too many dependencies involved with autogen 5.16, I can only download the official release and patch in the deltas. Did the PF_RING libpcap fix touched any other files in addition to configure and configure.ac?

fklassen commented 10 years ago

Yes, it is unfortunate that the author of autogen made it so version dependent. If you clone from github you need to have autogen 5.16.2. We always suggest that unless you are a Tcpreplay developer, download our distributed source. That way you don't need autogen installed.

In this case I suggest getting our 4.0.5 Beta1 pre-release. Note that I plan to have a Beta 2 available soon (today or tomorrow). Either way, PF_RING is supported with syntax similar to ...

./configure --with-libpcap=/home/fklassen/git/PF_RING/userland/libpcap
make

Final note. Today I got confirmation from Luca Deri that he has assigned someone to do some testing of Tcpreplay with PF_RING. I hope to hear the results soon.

morphyno commented 10 years ago

I was wrong, when I tried configuring it with PF_RING libpcap using the latest tcpreplay (git) on my ubuntu VM, the linking failed as well

fklassen commented 10 years ago

Please provide an error message. I have another report of a PF_RING issue and I want to see if you are having a similar issue.

morphyno commented 10 years ago

I just tried this on tcpreplay 4.0.5 beta 3 and now building with PF_RING libpcap works fine. I've attached this config.log. This issue can be closed

On Wed, Jul 30, 2014 at 12:07 PM, Fred Klassen notifications@github.com wrote:

Please provide an error message. I have another report of a PF_RING issue and I want to see if you are having a similar issue.

— Reply to this email directly or view it on GitHub https://github.com/appneta/tcpreplay/issues/104#issuecomment-50664241.

All in a can, just add water and stir goodness

fklassen commented 10 years ago

Glad to hear that this got fixed for 4.0.5.