mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-01 12:00:53 +00:00
Fix bug #49264: Crash Error when LWIP_SOCKET_OFFSET is in use
Handle LWIP_SOCKET_OFFSET in lwip_socket_drop_registered_memberships, lwip_socket_unregister_membership and lwip_socket_register_membership.
This commit is contained in:
parent
d1ed89b2e4
commit
30251b1404
@ -2732,7 +2732,7 @@ lwip_socket_register_membership(int s, const ip4_addr_t *if_addr, const ip4_addr
|
||||
{
|
||||
/* s+1 is stored in the array to prevent having to initialize the array
|
||||
(default initialization is to 0) */
|
||||
int sa = s + 1;
|
||||
int sa = s + 1 - LWIP_SOCKET_OFFSET;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < LWIP_SOCKET_MAX_MEMBERSHIPS; i++) {
|
||||
@ -2756,7 +2756,7 @@ lwip_socket_unregister_membership(int s, const ip4_addr_t *if_addr, const ip4_ad
|
||||
{
|
||||
/* s+1 is stored in the array to prevent having to initialize the array
|
||||
(default initialization is to 0) */
|
||||
int sa = s + 1;
|
||||
int sa = s + 1 - LWIP_SOCKET_OFFSET;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < LWIP_SOCKET_MAX_MEMBERSHIPS; i++) {
|
||||
@ -2779,7 +2779,7 @@ static void lwip_socket_drop_registered_memberships(int s)
|
||||
{
|
||||
/* s+1 is stored in the array to prevent having to initialize the array
|
||||
(default initialization is to 0) */
|
||||
int sa = s + 1;
|
||||
int sa = s + 1 - LWIP_SOCKET_OFFSET;
|
||||
int i;
|
||||
|
||||
LWIP_ASSERT("socket has no netconn", sockets[s].conn != NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user