lwip-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-commits] [SCM] lwIP - A Lightweight TCPIP stack branch, master


From: address@hidden
Subject: Re: [lwip-commits] [SCM] lwIP - A Lightweight TCPIP stack branch, master, updated. master_at_STABLE-2_0_0-990-gcf07fdd
Date: Thu, 19 Oct 2017 19:40:45 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Joel Cunningham wrote:
There seems to be varying usage of SYS_ARCH_PROTECT() around calls to tryget_socket_unconn() and tryget_socket_unconn_nouse(). What cases should those calls be protected? At first, I thought maybe tryget_socket_unconn() always required SYS_ARCH_PROTECT due to incrementing the socket used counter, but sock_inc_used() is already internally uses SYS_ARCH_PROTECT

tryget_socket_unconn() must be called protected or there would be a race between tryget_socket_unconn_nouse() returning a socket and calling sock_inc_used(ret). It's true that in this case, the latter wouldn't need protection itself...

Looking through the code, there *is* a race condition when called from get_socket(), which always seems to be called unlocked. I'll file a bug for this.

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]