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 <[email protected]> wrote:

> 2017-10-24 16:37 GMT+08:00 Axel Lin <[email protected]>:
> > 2017-10-24 1:13 GMT+08:00 Mattia Settin <[email protected]>:
> >> 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
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
Mattia Settin
System engineer
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to