mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-07 20:31:20 +08:00
wireless: gs2200m: Fix to handle address info in accept()
Summary: - This commit fixes to handle address info in accept() Impact: - All use cases which use accept() with gs2200m - Need to update nuttx as well Testing: - Tested with spresene:wifi - Tested with telnet daemon Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
196b1f06df
commit
0e9594e107
@ -1132,7 +1132,6 @@ static int accept_request(int fd, FAR struct gs2200m_s *priv,
|
|||||||
struct gs2200m_accept_msg amsg;
|
struct gs2200m_accept_msg amsg;
|
||||||
FAR struct usock_s *usock;
|
FAR struct usock_s *usock;
|
||||||
FAR struct usock_s *new_usock = NULL;
|
FAR struct usock_s *new_usock = NULL;
|
||||||
struct sockaddr_in ep_addr;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int16_t usockid; /* usockid for new client */
|
int16_t usockid; /* usockid for new client */
|
||||||
|
|
||||||
@ -1173,6 +1172,7 @@ static int accept_request(int fd, FAR struct gs2200m_s *priv,
|
|||||||
|
|
||||||
new_usock->cid = amsg.cid;
|
new_usock->cid = amsg.cid;
|
||||||
new_usock->state = CONNECTED;
|
new_usock->state = CONNECTED;
|
||||||
|
new_usock->raddr = amsg.addr;
|
||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
|
|
||||||
@ -1185,8 +1185,8 @@ prepare:
|
|||||||
|
|
||||||
if (0 == ret)
|
if (0 == ret)
|
||||||
{
|
{
|
||||||
resp.reqack.result = 2; /* ep_addr + usock */
|
resp.reqack.result = 2; /* new_usock->raddr + usock */
|
||||||
resp.valuelen_nontrunc = sizeof(ep_addr);
|
resp.valuelen_nontrunc = sizeof(new_usock->raddr);
|
||||||
resp.valuelen = resp.valuelen_nontrunc;
|
resp.valuelen = resp.valuelen_nontrunc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1208,11 +1208,7 @@ prepare:
|
|||||||
{
|
{
|
||||||
/* Send address (value) */
|
/* Send address (value) */
|
||||||
|
|
||||||
/* TODO: ep_addr should be set */
|
ret = _write_to_usock(fd, &new_usock->raddr, resp.valuelen);
|
||||||
|
|
||||||
memset(&ep_addr, 0, sizeof(ep_addr));
|
|
||||||
|
|
||||||
ret = _write_to_usock(fd, &ep_addr, resp.valuelen);
|
|
||||||
|
|
||||||
if (0 > ret)
|
if (0 > ret)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user