improved PAP control structure size

This commit is contained in:
Sylvain Rochet 2012-06-19 23:37:33 +02:00
parent 0bdc27186d
commit 0234c62c3e
2 changed files with 11 additions and 11 deletions

View File

@ -163,9 +163,9 @@ void upap_authwithpeer(ppp_pcb *pcb, char *user, char *password) {
/* Save the username and password we're given */ /* Save the username and password we're given */
pcb->upap.us_user = user; pcb->upap.us_user = user;
pcb->upap.us_userlen = strlen(user); pcb->upap.us_userlen = LWIP_MIN(strlen(user), 0xff);
pcb->upap.us_passwd = password; pcb->upap.us_passwd = password;
pcb->upap.us_passwdlen = strlen(password); pcb->upap.us_passwdlen = LWIP_MIN(strlen(password), 0xff);
pcb->upap.us_transmits = 0; pcb->upap.us_transmits = 0;
/* Lower layer up yet? */ /* Lower layer up yet? */

View File

@ -99,18 +99,18 @@
#if PAP_SUPPORT #if PAP_SUPPORT
typedef struct upap_state { typedef struct upap_state {
char *us_user; /* User */ char *us_user; /* User */
int us_userlen; /* User length */ u8_t us_userlen; /* User length */
char *us_passwd; /* Password */ char *us_passwd; /* Password */
int us_passwdlen; /* Password length */ u8_t us_passwdlen; /* Password length */
int us_clientstate; /* Client state */ u8_t us_clientstate; /* Client state */
#if PPP_SERVER #if PPP_SERVER
int us_serverstate; /* Server state */ u8_t us_serverstate /* Server state */
#endif /* PPP_SERVER */ #endif /* PPP_SERVER */
u_char us_id; /* Current id */ u8_t us_id; /* Current id */
int us_timeouttime; /* Timeout (seconds) for auth-req retrans. */ u8_t us_timeouttime; /* Timeout (seconds) for auth-req retrans. */
int us_transmits; /* Number of auth-reqs sent */ u8_t us_transmits; /* Number of auth-reqs sent */
int us_maxtransmits; /* Maximum number of auth-reqs to send */ u8_t us_maxtransmits; /* Maximum number of auth-reqs to send */
int us_reqtimeout; /* Time to wait for auth-req from peer */ u8_t us_reqtimeout; /* Time to wait for auth-req from peer */
} upap_state; } upap_state;
#endif /* PAP_SUPPORT */ #endif /* PAP_SUPPORT */