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

Commit

Permalink
[nrf noup] zephyr: Start DHCP client only in station mode
Browse files Browse the repository at this point in the history
DHCP client is needed only when the device is running in
station mode. Check if the SSID is configured in SME structure
which indicates that the given interface is operating
in STA mode.

Signed-off-by: Ravi Dondaputi <[email protected]>
  • Loading branch information
rado17 committed Jun 6, 2024
1 parent e2b94fd commit 1ac7e7f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/drivers/driver_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,10 +1525,14 @@ static int wpa_drv_zep_set_supp_port(void *priv,
authorized,
if_ctx->bssid);

#ifdef CONFIG_NET_DHCPV4
if (authorized) {
net_dhcpv4_restart(iface);
}
#if defined(CONFIG_NET_DHCPV4) && defined(CONFIG_SME)
struct wpa_supplicant *wpa_s = if_ctx->supp_if_ctx;
/* Need DHCP client in STA mode only */
if (wpa_s && wpa_s->sme.ssid_len > 0) {
if (authorized) {
net_dhcpv4_restart(iface);
}
}
#endif

return ret;
Expand Down

0 comments on commit 1ac7e7f

Please sign in to comment.