F-Stack / f-stack

F-Stack is an user space network development kit with high performance based on DPDK, FreeBSD TCP/IP stack and coroutine API.
http://www.f-stack.org
Other
3.87k stars 898 forks source link

implementation of IP_RECVOPTS #670

Open FidaullahNoonari-emumba opened 2 years ago

FidaullahNoonari-emumba commented 2 years ago

I was building an application on F-Stack and I wanted to use IP_RECVOPTS flag. This is where I found out that this flag is not implemented in FreeBSD TCP/IP stack. upon further investigation I came across the following code.

sys/netinet/ip_input.c ip_savecontrol() line 1150

#ifdef notyet
    /* XXX
     * Moving these out of udp_input() made them even more broken
     * than they already were.
     */
    /* options were tossed already */
    if (inp->inp_flags & INP_RECVOPTS) {
        *mp = sbcreatecontrol(opts_deleted_above,
            sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP, M_NOWAIT);
        if (*mp)
            mp = &(*mp)->m_next;
    }
    /* ip_srcroute doesn't do what we want here, need to fix */
    if (inp->inp_flags & INP_RECVRETOPTS) {
        *mp = sbcreatecontrol(ip_srcroute(m), sizeof(struct in_addr),
            IP_RECVRETOPTS, IPPROTO_IP, M_NOWAIT);
        if (*mp)
            mp = &(*mp)->m_next;
    }
#endif

Removing this #ifdef statement make IP_RECVOPTS works but I am concerned about the comment that mention this block "made them broken" I want to how this made them broken in FreeBSD and is it still broken in F-Stack.

jfb8856606 commented 2 years ago

I also don't know more about it.

I saw this question on the FreeBSD forum, to wait if there is a follow-up reply.