I'm working on a TCP/IP stack, that currently runs from Linux user space using raw sockets.
To test this, I need to disable the Linux Kernel TCP code for a specific port, so that the kernel doesn't screw with my implementation (eg. kernel responding to handshake).
I've referenced this, which says that raw sockets bypass netfilter, but during my testing, the packet is not received by the raw socket.
After more research I discovered that my AF_INET socket is still in the TCP/IP stack, however I do not want to implement Ethernet frames.
Is there anyway to disable the kernel processing on a specific port without using AF_PACKET?
I am creating my socket like so:
socket(AF_INET, SOCK_RAW, IPPROTO_TCP).
I then set HDRINCL:
setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on))