I have a program which uses libpcap to capture incoming TCP SYN packets, these SYN packets are destined for a specific port.
But I have no tcp listening socket for that port, so in practice, the OS Kernel(it is the kernel or the tcp stack? I'm not sure, can anyone tell me) will issue a RST to the source ip of the TCP SYN.
now I want to prevent the RST, I don't want the RST to be sent to the source ip. I think maybe iptables can do this? so how to set the rules with iptables to prevent these RSTs (which are triggered by incoming TCP SYN for a specific port)?
if there are other better solutions, that's better! thanks!