Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofp tcp_reassembly not flushing the odp_packets causing packet leak #267

Open
vishoo opened this issue Apr 15, 2021 · 1 comment
Open

ofp tcp_reassembly not flushing the odp_packets causing packet leak #267

vishoo opened this issue Apr 15, 2021 · 1 comment

Comments

@vishoo
Copy link

vishoo commented Apr 15, 2021

The tcp resassembly code does not flush the odp_packets which are attached to the tcp_segment while closing the connection and flushing the tcp reassembly list.
In file ofp_tcp_reass.c
void
ofp_tcp_reass_flush(struct tcpcb *tp)
{
struct tseg_qent *qe;

    INP_WLOCK_ASSERT(tp->t_inpcb);

    while ((qe = OFP_LIST_FIRST(&tp->t_segq)) != NULL) {
            OFP_LIST_REMOVE(qe, tqe_q);

            odp_packet_free(qe->tqe_m);  // This code is necessary to free the odp packets which are held by the tcp segments  as part of re-assembly list.** 

            uma_zfree(V_tcp_reass_zone, qe);
            tp->t_segqlen--;
    }

    KASSERT((tp->t_segqlen == 0),
        ("TCP reass queue %p segment count is %d instead of 0 after flush.",
        tp, tp->t_segqlen));

}

After having this fix in code, we dont see any packet buffer leaks. Please let me know if its ok , then I can push the changes.
Have submitted changes for review!

@bogdanPricope
Copy link
Contributor

Looks OK to me. Unfortunately there is no 'maintainer' still active on OFP.

cjsworld added a commit to cjsworld/ofp that referenced this issue Nov 25, 2022
cjsworld added a commit to cjsworld/ofp that referenced this issue Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants