mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-06 06:04:33 +02:00
Merge branch 'lwip/restrict_dhcp_server_client_together' into 'master'
esp-lwip: Restrict configuring DHCP server and client together See merge request espressif/esp-idf!22137
This commit is contained in:
@@ -682,6 +682,16 @@ esp_netif_t *esp_netif_new(const esp_netif_config_t *esp_netif_config)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ESP_DHCPS
|
||||||
|
// DHCP server and client cannot be configured together
|
||||||
|
if((esp_netif_config->base->flags & ESP_NETIF_DHCP_SERVER) &&
|
||||||
|
(esp_netif_config->base->flags & ESP_NETIF_DHCP_CLIENT)) {
|
||||||
|
ESP_LOGE(TAG, "%s: Failed to configure netif with config=%p (DHCP server and client cannot be configured together)",
|
||||||
|
__func__, esp_netif_config);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Create parent esp-netif object
|
// Create parent esp-netif object
|
||||||
esp_netif_t *esp_netif = calloc(1, sizeof(struct esp_netif_obj));
|
esp_netif_t *esp_netif = calloc(1, sizeof(struct esp_netif_obj));
|
||||||
if (!esp_netif) {
|
if (!esp_netif) {
|
||||||
|
Reference in New Issue
Block a user