Drop packet with libpcap
问题 Is it possible to have libpcap remove a packet instead of just sniff it as it passes through? I'm wanting to intercept each packet and encapsulate it into a new packet along with measurement data, but both packets (mine and the original) both reach the destination. 回答1: It's not possible. You need to write a driver (for your operating system) to make the networking stack filter out packets. 回答2: The only way you could do this is by being the only physical path between the sender and receiver