PPP: don't build ppp_set_auth if no authenticator are enabled

For our few users which might disable all authenticators to save some
flash, ensure that everything using authentication is build out.
This commit is contained in:
Sylvain Rochet 2016-07-02 19:43:08 +02:00
parent c1c3d0e1ba
commit f21aede031
2 changed files with 3 additions and 8 deletions

View File

@ -427,6 +427,7 @@ struct ppp_pcb_s {
* only be called while the PPP is in the dead phase (i.e. disconnected). * only be called while the PPP is in the dead phase (i.e. disconnected).
*/ */
#if PPP_AUTH_SUPPORT
/* /*
* Set PPP authentication. * Set PPP authentication.
* *
@ -458,7 +459,6 @@ struct ppp_pcb_s {
#define PPPAUTHTYPE_ANY 0xff #define PPPAUTHTYPE_ANY 0xff
void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd); void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd);
#if PPP_AUTH_SUPPORT
/* /*
* Whether peer is required to authenticate. This is mostly necessary for PPP server support. * Whether peer is required to authenticate. This is mostly necessary for PPP server support.
*/ */

View File

@ -209,8 +209,8 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc
/***********************************/ /***********************************/
/*** PUBLIC FUNCTION DEFINITIONS ***/ /*** PUBLIC FUNCTION DEFINITIONS ***/
/***********************************/ /***********************************/
void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd) {
#if PPP_AUTH_SUPPORT #if PPP_AUTH_SUPPORT
void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd) {
#if PAP_SUPPORT #if PAP_SUPPORT
pcb->settings.refuse_pap = !(authtype & PPPAUTHTYPE_PAP); pcb->settings.refuse_pap = !(authtype & PPPAUTHTYPE_PAP);
#endif /* PAP_SUPPORT */ #endif /* PAP_SUPPORT */
@ -226,13 +226,8 @@ void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *pas
#endif /* EAP_SUPPORT */ #endif /* EAP_SUPPORT */
pcb->settings.user = user; pcb->settings.user = user;
pcb->settings.passwd = passwd; pcb->settings.passwd = passwd;
#else /* PPP_AUTH_SUPPORT */
LWIP_UNUSED_ARG(pcb);
LWIP_UNUSED_ARG(authtype);
LWIP_UNUSED_ARG(user);
LWIP_UNUSED_ARG(passwd);
#endif /* PPP_AUTH_SUPPORT */
} }
#endif /* PPP_AUTH_SUPPORT */
#if MPPE_SUPPORT #if MPPE_SUPPORT
/* Set MPPE configuration */ /* Set MPPE configuration */