chunk.queue.ifindex = devices_registered[i];
working = 1;
+ int offset = 0;
for (j = 0; j < chunk_size; j++) {
+
+ packet_size = rand() % 2 + 400;
chunk.info[j].len = packet_size;
// chunk.info[j].offset = j * PS_ALIGN(packet_size, 64);
+ chunk.info[j].offset = offset;
+ offset = PS_ALIGN(offset + packet_size, 64);
if (num_flows == 0){
I use the libpcap reading the packet at another mechine, use the libnids processing the packet, I find some packet's cap_length - linkoffset is less than ip header's ip total length , like this:
caplen - linkoffset < ntohs(iph->ip_len)
But the length is not random, it is also the packet we build, it's length should be 401 , but when I receive, it is 400.