Jelajahi Sumber

esp_netif_lwip_ppp: Allow esp_netif_ppp_set_auth set auth_type with NETIF_PPP_AUTHTYPE_NONE

The ppp_set_auth() is guard by #if PPP_AUTH_SUPPORT in lwIP, so
make it consistent. This also simplify the code a bit because the code
in #if PAP_SUPPORT guard and #if CHAP_SUPPORT guard are exactly the same.

Once NETIF_PPP_AUTHTYPE_NONE added to esp_netif_auth_type_t, it also allows
setting NETIF_PPP_AUTHTYPE_NONE with this change.

Signed-off-by: Axel Lin <axel.lin@gmail.com>

Merges https://github.com/espressif/esp-idf/pull/4639
Axel Lin 6 tahun lalu
induk
melakukan
4c668ff3d3
1 mengubah file dengan 1 tambahan dan 3 penghapusan
  1. 1 3
      components/esp_netif/lwip/esp_netif_lwip_ppp.c

+ 1 - 3
components/esp_netif/lwip/esp_netif_lwip_ppp.c

@@ -207,10 +207,8 @@ esp_err_t esp_netif_ppp_set_auth(esp_netif_t *netif, esp_netif_auth_type_t autht
     if (netif == NULL || !netif->is_ppp_netif) {
         return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
     }
+#if PPP_AUTH_SUPPORT
     struct lwip_ppp_ctx *obj =  netif->lwip_ppp_ctx;
-#if PAP_SUPPORT
-    pppapi_set_auth(obj->ppp, authtype, user, passwd);
-#elif CHAP_SUPPORT
     pppapi_set_auth(obj->ppp, authtype, user, passwd);
 #else
 #error "Unsupported AUTH Negotiation"