]> granicus.if.org Git - esp-idf/commitdiff
lwip: Fix hostname set in tcpip_adapter_lwip
authoralarruskain <alarruskain@users.noreply.github.com>
Fri, 17 Feb 2017 10:02:00 +0000 (11:02 +0100)
committerAngus Gratton <angus@espressif.com>
Fri, 3 Mar 2017 03:59:15 +0000 (14:59 +1100)
Hostname for each interface is not correctly stored in "hostinfo" variable.

Merges #350 https://github.com/espressif/esp-idf/pull/350

components/tcpip_adapter/tcpip_adapter_lwip.c

index 40f235d545c77402ce1220c22f785017b5724eb3..6e166175479944c3df9231d93c3e19993124c122 100644 (file)
@@ -713,7 +713,7 @@ esp_err_t tcpip_adapter_set_hostname(tcpip_adapter_if_t tcpip_if, const char *ho
 {
 #if LWIP_NETIF_HOSTNAME
     struct netif *p_netif;
-    static char hostinfo[TCPIP_HOSTNAME_MAX_SIZE + 1][TCPIP_ADAPTER_IF_MAX];
+    static char hostinfo[TCPIP_ADAPTER_IF_MAX][TCPIP_HOSTNAME_MAX_SIZE + 1];
 
     if (tcpip_if >= TCPIP_ADAPTER_IF_MAX || hostname == NULL) {
         return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS;