Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Linker error in txring.c using Android NDK version 23 #731

Open
NghiaNT1989 opened this issue Jun 13, 2022 · 1 comment
Open

[Bug] Linker error in txring.c using Android NDK version 23 #731

NghiaNT1989 opened this issue Jun 13, 2022 · 1 comment
Assignees

Comments

@NghiaNT1989
Copy link

NghiaNT1989 commented Jun 13, 2022

Describe the bug
A clear and concise description of what the bug is.
Linker error in txring.c using Android NDK version 23

ld: error: undefined symbol: txring_put
>>> referenced by sendpacket.c:303
>>>               sendpacket.o:(sendpacket) in archive ./common/libcommon.a

ld: error: undefined symbol: txring_init
>>> referenced by sendpacket.c:990
>>>               sendpacket.o:(sendpacket_open) in archive ./common/libcommon.a

To Reproduce
Steps to reproduce the behavior:

  1. after configuration, we will have
Supported Packet Injection Methods (*):
Linux TX_RING:              yes
Linux PF_PACKET:            yes
  1. run : make

Expected behavior
Make should be finished without any error

Screenshots

System (please complete the following information):

  • OS: Ubuntu
  • OS 18.04 LTS
  • Tcpreplay Version : latest release in master branch with commit : 09f0774

Additional context
The macro HAVE_TX_RING is defined in config.h

/* Do we have Linux TX_RING socket support? */
#define HAVE_TX_RING 1

in header file : txring.h, we include config.h then check ifdef HAVE_TX_RING, it's OK, definition of HAVE_TX_RING is now available in txring.h.

#include "config.h"
#include "defines.h"

#ifdef HAVE_TX_RING

However, in txring.c, check ifdef HAVE_TX_RING is added firstly but it's not yet defined.

#ifdef HAVE_TX_RING

#include "err.h"
#include "utils.h"
#include "txring.h"
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include <errno.h>

we need to move ifdef HAVE_TX_RING after header inclusion, like this

#include "err.h"
#include "utils.h"
#include "txring.h"
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include <errno.h>

#ifdef HAVE_TX_RING
@fklassen fklassen added this to To do in 4.4.2 via automation Aug 7, 2022
@fklassen fklassen self-assigned this Aug 7, 2022
@fklassen fklassen removed this from To do in 4.4.2 Aug 7, 2022
@fklassen
Copy link
Member

fklassen commented Aug 7, 2022

I had a quick look and it seems obvious that HAVE_TX_RING has not been able to compile for a very long time. If someone wants to fix it, I'll put it in an enhancement release. I have no way of testing it in my test jig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants