mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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
This commit is contained in:
parent
57a56b55c0
commit
3f5d19016a
@ -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) {
|
if (netif == NULL || !netif->is_ppp_netif) {
|
||||||
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
||||||
}
|
}
|
||||||
|
#if PPP_AUTH_SUPPORT
|
||||||
struct lwip_ppp_ctx *obj = netif->lwip_ppp_ctx;
|
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);
|
pppapi_set_auth(obj->ppp, authtype, user, passwd);
|
||||||
#else
|
#else
|
||||||
#error "Unsupported AUTH Negotiation"
|
#error "Unsupported AUTH Negotiation"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user