File tree 1 file changed +17
-0
lines changed
components/esp_netif/lwip
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2258,6 +2258,23 @@ esp_err_t esp_netif_dhcps_option_api(esp_netif_api_msg_t *msg)
2258
2258
break ;
2259
2259
}
2260
2260
case ESP_NETIF_SUBNET_MASK : {
2261
+ esp_netif_ip_info_t * default_ip = esp_netif -> ip_info ;
2262
+ ip4_addr_t * config_netmask = (ip4_addr_t * )opt -> val ;
2263
+ if (!memcmp (& default_ip -> netmask , config_netmask , sizeof (struct ip4_addr ))) {
2264
+ ESP_LOGE (TAG , "Please use esp_netif_set_ip_info interface to configure subnet mask" );
2265
+ /*
2266
+ * This API directly changes the subnet mask of dhcp server
2267
+ * but the subnet mask of the network interface has not changed
2268
+ * If you need to change the subnet mask of dhcp server
2269
+ * you need to change the subnet mask of the network interface first.
2270
+ * If the subnet mask of dhcp server is changed
2271
+ * and the subnet mask of network interface is inconsistent
2272
+ * with the subnet mask of dhcp sever, it may lead to the failure of sending packets.
2273
+ * If want to configure the subnet mask of dhcp server
2274
+ * please use esp_netif_set_ip_info to change the subnet mask of network interface first.
2275
+ */
2276
+ return ESP_ERR_ESP_NETIF_INVALID_PARAMS ;
2277
+ }
2261
2278
memcpy (opt_info , opt -> val , opt -> len );
2262
2279
break ;
2263
2280
}
You can’t perform that action at this time.
0 commit comments