I've updated the remaining comments to mention the same priority on git master

Another thing you could do is have your application track number of active connections, make sure enough TCP pcbs are configured and then close the listener pcb once the maximum is reach.

Joel


On 10/24/2017 10:38 AM, Mattia Settin wrote:
Yes
The main problem was related that the tcp_kill_prio() kills the active pcb with a priority equals to the pcb passaed in input. For my specific web server application, this lead to send a (sporadic) RST ACK to the client, when the tcp_alloc fails to allocate new connection.
br


On Tue, Oct 24, 2017 at 4:34 PM, Axel Lin <axel....@ingics.com <mailto:axel....@ingics.com>> wrote:

    2017-10-24 16:37 GMT+08:00 Axel Lin <axel....@ingics.com
    <mailto:axel....@ingics.com>>:
    > 2017-10-24 1:13 GMT+08:00 Mattia Settin <mattia.set...@gmail.com
    <mailto:mattia.set...@gmail.com>>:
    >> Dear all
    >> After a week of debugging I finally find the issue. The problem
    is related to priority in pcb.
    >> Taking a deep look I saw that the priority in the stack 1.4.1
    is change, in particular:
    >> Tcp_alloc return e pcb with a prior equal to the prior passed
    in input.
    >> Tcp_listen_with_backlog return e pcb with a prior equal to the
    pcb.prior passed in input.
    >> This two changes lead to a sporadic RST ACK call from the
    kill_prio routine.
    >> Finally I fix this issue removing the equal condition in the
    kill_prio function.
    >
    > The comment on the code seems confusion for "the same priority
    case":
    > (I check the latest git tree)
    >
    > Th comment on the caller:
    >           /* Try killing active connections with lower priority than
    > the new one. */
    >           LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing connection
    with
    > prio lower than %d\n", prio));
    >           tcp_kill_prio(prio);
    >
    > But the comment on tcp_kill_prio() function:
    > /**
    >  * Kills the oldest active connection that has the same or lower
    priority than
    >  * 'prio'.

    The comment for tcp_kill_prio() is updated by:
    commit 6a4c30fe5d65 fixed bug #31723 (tcp_kill_prio() kills pcbs with
    the same prio) by updating its documentation only

    And take a look at bug #31723: tcp_kill_prio() kills pcbs with the
    same prio

    According to its documentation, tcp_kill_prio() kills "the oldest
    active connection that has lower priority than prio". However, the
    current code also kills connections with a priority equal to 'prio'.
    We should either change the documentation or the implementation.
    The downside of the current implementation is that every call to
    tcp_new() can lead to aborting an old (active) connection.
    This has been in there since revision 1.1 of tcp.c, so changing it
    might involve changing applications relying on this (like I have one
    :).

    I'm wondering if it should change the implementation rather than the
    documentation.

    _______________________________________________
    lwip-users mailing list
    lwip-users@nongnu.org <mailto:lwip-users@nongnu.org>
    https://lists.nongnu.org/mailman/listinfo/lwip-users
    <https://lists.nongnu.org/mailman/listinfo/lwip-users>




--
Mattia Settin
System engineer




_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to