At machine_1, I'm capturing filtered packets with destination address as machine_1. I'm also sending raw packets from machine_2 with destination set as machine_1. At machine_2, I'm getting packets to send to machine_1 by sniffing them in exactly the same way as said for machine_1.
What is happening is that sometimes I'm getting packets at machine_1 when i send them from machine_2 and sometimes I'm not getting them.
In machine_1 my program is multi-threaded. Can that be the reason..?
Winpcap pcap_dispatch() to get packets.
pcap_sendpacket() to send packets.
make_filter("dst host 18.104.22.168") //filter at machine_1
22.214.171.124 macchine_1 ip address
As he said he is using Multi-Threaded that means that pcap should not drop any packets right?
Also in the Kernel the BPF casts a lot of threads to filter data.
I personally suggest you try develop NDIS driver filter drivers becuase you then you can cast how many threads you wish whereas if BPF does not process packets at the same speed as you, this can cause loss of packet capture.