drivers: wireless: Fix to handle address info in accept() in gs2200m.c

Summary:
- This commit fixes to handle address info in accept() in gs2200m.c

Impact:
- All use cases which use accept() with gs2200m
- Need to update apps/wireless/gs2200m 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:
Masayuki Ishikawa 2020-10-12 13:10:23 +09:00 committed by Abdelatif Guettouche
parent 7244e771e7
commit 620f33ba9f
2 changed files with 12 additions and 0 deletions

View file

@ -2450,6 +2450,8 @@ static int gs2200m_ioctl_accept(FAR struct gs2200m_dev_s *dev,
FAR struct gs2200m_accept_msg *msg)
{
FAR struct pkt_dat_s *pkt_dat;
struct gs2200m_name_msg nmsg;
enum pkt_type_e r;
uint8_t c;
char s_cid;
char c_cid;
@ -2486,6 +2488,15 @@ static int gs2200m_ioctl_accept(FAR struct gs2200m_dev_s *dev,
_notif_q_push(dev, c_cid);
}
/* Obtain remote address info */
nmsg.local = 0;
nmsg.cid = msg->cid;
r = gs2200m_get_cstatus(dev, &nmsg);
ASSERT(TYPE_OK == r);
msg->addr = nmsg.addr;
wlinfo("+++ end: type=%d (msg->cid=%c) \n", msg->type, msg->cid);
return OK;

View file

@ -94,6 +94,7 @@ struct gs2200m_bind_msg
struct gs2200m_accept_msg
{
struct sockaddr_in addr;
char cid;
uint8_t type;
};