diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index b29117d5..d190906f 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -2054,6 +2054,11 @@ #ifndef PPP_SERVER #define PPP_SERVER 0 #endif +#if PPP_SERVER +#ifndef PPP_OUR_NAME +#define PPP_OUR_NAME "lwIP" /* Our name for authentication purposes */ +#endif +#endif /* PPP_SERVER */ /** * VJ_SUPPORT==1: Support VJ header compression. diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index 310f1c7d..843f42f4 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -242,9 +242,6 @@ typedef struct ppp_settings_s { /* auth data */ const char *user; /* Username for PAP */ const char *passwd; /* Password for PAP, secret for CHAP */ -#if PPP_SERVER - char our_name [MAXNAMELEN + 1]; /* Our name for authentication purposes */ -#endif /* PPP_SERVER */ #if PPP_REMOTENAME char remote_name[MAXNAMELEN + 1]; /* Peer's name for authentication */ #endif /* PPP_REMOTENAME */ diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index 3431c6c2..fc7d94a0 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -794,13 +794,13 @@ void link_established(ppp_pcb *pcb) { #if PPP_SERVER #if EAP_SUPPORT if (go->neg_eap) { - eap_authpeer(pcb, pcb->settings.our_name); + eap_authpeer(pcb, PPP_OUR_NAME); auth |= EAP_PEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (go->neg_chap) { - chap_auth_peer(pcb, pcb->settings.our_name, CHAP_DIGEST(go->chap_mdtype)); + chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); auth |= CHAP_PEER; } else #endif /* CHAP_SUPPORT */