Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
[nrf noup] Fix control interface socket close
Browse files Browse the repository at this point in the history
We register Socket 1 to Eloop, so, socket 1 should be closed.

Fixes SHEL-1872.

Signed-off-by: Krishna T <[email protected]>
  • Loading branch information
krishna T authored and krish2718 committed Aug 14, 2023
1 parent 94b1d13 commit 44c4504
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions wpa_supplicant/ctrl_iface_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ void wpa_supplicant_ctrl_iface_deinit(struct wpa_supplicant *wpa_s,
if (!priv)
return;

if (priv->sock_pair[0] > -1) {
eloop_unregister_read_sock(priv->sock_pair[0]);
close(priv->sock_pair[0]);
priv->sock_pair[0] = -1;
if (priv->sock_pair[1] > -1) {
eloop_unregister_read_sock(priv->sock_pair[1]);
close(priv->sock_pair[1]);
priv->sock_pair[1] = -1;
}

if (priv->sock_pair[1] >= 0)
close(priv->sock_pair[1]);
if (priv->sock_pair[0] >= 0)
close(priv->sock_pair[0]);

os_free(priv);
}
Expand Down Expand Up @@ -213,14 +213,14 @@ wpa_supplicant_global_ctrl_iface_deinit(struct ctrl_iface_global_priv *priv)
if (!priv)
return;

if (priv->sock_pair[0] > -1) {
eloop_unregister_read_sock(priv->sock_pair[0]);
close(priv->sock_pair[0]);
priv->sock_pair[0] = -1;
if (priv->sock_pair[1] > -1) {
eloop_unregister_read_sock(priv->sock_pair[1]);
close(priv->sock_pair[1]);
priv->sock_pair[1] = -1;
}

if (priv->sock_pair[1] >= 0)
close(priv->sock_pair[1]);
if (priv->sock_pair[0] >= 0)
close(priv->sock_pair[0]);

os_free(priv);
}

0 comments on commit 44c4504

Please sign in to comment.