From b9cb35bb5d028d33ac1a7c8696275c540177ac6d Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 13 Jan 2020 16:24:14 +0800 Subject: [PATCH] pppapi: Add #if PPP_AUTH_SUPPORT guard for pppapi_set_auth() The ppp_set_auth() is guarded by PPP_AUTH_SUPPORT, so the pppapi_set_auth and pppapi_do_ppp_set_auth should also use the same #if guard. This fixes build error if ESP_PPP is set but both PAP and CHAP are disabled. Signed-off-by: Axel Lin --- src/include/netif/ppp/pppapi.h | 4 ++-- src/netif/ppp/pppapi.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/netif/ppp/pppapi.h b/src/include/netif/ppp/pppapi.h index cc1f221d..8c136f53 100644 --- a/src/include/netif/ppp/pppapi.h +++ b/src/include/netif/ppp/pppapi.h @@ -47,7 +47,7 @@ extern "C" { struct pppapi_msg_msg { ppp_pcb *ppp; union { -#if ESP_PPP +#if ESP_PPP && PPP_AUTH_SUPPORT struct { u8_t authtype; const char *user; @@ -111,7 +111,7 @@ struct pppapi_msg { /* API for application */ err_t pppapi_set_default(ppp_pcb *pcb); -#if ESP_PPP +#if ESP_PPP && PPP_AUTH_SUPPORT void pppapi_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd); #endif #if PPP_NOTIFY_PHASE diff --git a/src/netif/ppp/pppapi.c b/src/netif/ppp/pppapi.c index 8608978c..1aeefaff 100644 --- a/src/netif/ppp/pppapi.c +++ b/src/netif/ppp/pppapi.c @@ -82,7 +82,7 @@ pppapi_set_default(ppp_pcb *pcb) return err; } -#if ESP_PPP +#if ESP_PPP && PPP_AUTH_SUPPORT /** * Call ppp_set_auth() inside the tcpip_thread context. */