From 4c668ff3d3dcd72ed36fc9436429fa6ac42f0da5 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 17 Jan 2020 09:54:38 +0800 Subject: [PATCH] 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 Merges https://github.com/espressif/esp-idf/pull/4639 --- components/esp_netif/lwip/esp_netif_lwip_ppp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/esp_netif/lwip/esp_netif_lwip_ppp.c b/components/esp_netif/lwip/esp_netif_lwip_ppp.c index 9a5cc9b015..3ebddd5ea7 100644 --- a/components/esp_netif/lwip/esp_netif_lwip_ppp.c +++ b/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"