PPP, don't store the name by which the peer authenticated itself to us if multilink support is disabled

pcb->peer_authname is only used by multilink support (which we don't
support), don't store the useless peer authname.
This commit is contained in:
Sylvain Rochet 2015-05-01 22:51:09 +02:00
parent 967a8d0678
commit 78e1b9b7c1
2 changed files with 8 additions and 3 deletions

View File

@ -359,9 +359,9 @@ struct ppp_pcb_s {
#if PPP_AUTH_SUPPORT #if PPP_AUTH_SUPPORT
/* auth data */ /* auth data */
#if PPP_SERVER #if PPP_SERVER && defined(HAVE_MULTILINK)
char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */ char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */
#endif /* PPP_SERVER */ #endif /* PPP_SERVER && defined(HAVE_MULTILINK) */
u16_t auth_pending; /* Records which authentication operations haven't completed yet. */ u16_t auth_pending; /* Records which authentication operations haven't completed yet. */
u16_t auth_done; /* Records which authentication operations have been completed. */ u16_t auth_done; /* Records which authentication operations have been completed. */

View File

@ -1045,6 +1045,10 @@ void auth_peer_fail(ppp_pcb *pcb, int protocol) {
*/ */
void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen) { void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen) {
int bit; int bit;
#ifndef HAVE_MULTILINK
LWIP_UNUSED_ARG(name);
LWIP_UNUSED_ARG(namelen);
#endif /* HAVE_MULTILINK */
switch (protocol) { switch (protocol) {
#if CHAP_SUPPORT #if CHAP_SUPPORT
@ -1082,14 +1086,15 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *
return; return;
} }
#ifdef HAVE_MULTILINK
/* /*
* Save the authenticated name of the peer for later. * Save the authenticated name of the peer for later.
*/ */
/* FIXME: do we need that ? */
if (namelen > (int)sizeof(pcb->peer_authname) - 1) if (namelen > (int)sizeof(pcb->peer_authname) - 1)
namelen = (int)sizeof(pcb->peer_authname) - 1; namelen = (int)sizeof(pcb->peer_authname) - 1;
MEMCPY(pcb->peer_authname, name, namelen); MEMCPY(pcb->peer_authname, name, namelen);
pcb->peer_authname[namelen] = 0; pcb->peer_authname[namelen] = 0;
#endif /* HAVE_MULTILINK */
#if 0 /* UNUSED */ #if 0 /* UNUSED */
script_setenv("PEERNAME", , 0); script_setenv("PEERNAME", , 0);
#endif /* UNUSED */ #endif /* UNUSED */