Libnids: Infinite loop in TCP Reassembly

56 views Asked by At

I am trying to run this code for Libnids library using these commands:

gcc -o myprog reassemble.c -lnids -lglib-2.0 -lpcap -lnet -lgthread-2.0 -g
sudo ./myprog

But it does not give any output. It acts like there are no captured packets on the provided network device, Although when I tried to capture packets separately, it works fine and packets are captured.

When I debug the code, it seems like the callback function is not called at all. By the way, I have tried the same code by registering UDP callback function instead, and it worked.

Does anyone suggest a solution for the problem? and Is there any other library to reassembly TCP packets in c language?

1

There are 1 answers

0
Radwa Ahmed On BEST ANSWER

With the help of this question, I have found the solution. I have used the following command:

ethtool -K <device_name> tx off sg off tso off

to disable TSO for a network device <device_name>, and it worked!