mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-13 02:05:43 +00:00
PPP, CCP, reworked ppp_pcb ccp_localstate and all_rejected fields
This commit is contained in:
parent
949d76b328
commit
40991b93a2
@ -366,12 +366,16 @@ struct ppp_pcb_s {
|
|||||||
unsigned int :2; /* 2 bit of padding */
|
unsigned int :2; /* 2 bit of padding */
|
||||||
#endif /* PPP_IPV6_SUPPORT */
|
#endif /* PPP_IPV6_SUPPORT */
|
||||||
unsigned int lcp_echo_timer_running :1; /* set if a timer is running */
|
unsigned int lcp_echo_timer_running :1; /* set if a timer is running */
|
||||||
|
#if CCP_SUPPORT
|
||||||
|
unsigned int ccp_all_rejected :1; /* we rejected all peer's options */
|
||||||
|
#else /* CCP_SUPPORT */
|
||||||
|
unsigned int :1; /* 1 bit of padding */
|
||||||
|
#endif /* CCP_SUPPORT */
|
||||||
#if MPPE_SUPPORT
|
#if MPPE_SUPPORT
|
||||||
unsigned int mppe_keys_set :1; /* Have the MPPE keys been set? */
|
unsigned int mppe_keys_set :1; /* Have the MPPE keys been set? */
|
||||||
#else /* MPPE_SUPPORT */
|
#else /* MPPE_SUPPORT */
|
||||||
unsigned int :1; /* 1 bit of padding */
|
unsigned int :1; /* 1 bit of padding */
|
||||||
#endif /* MPPE_SUPPORT */
|
#endif /* MPPE_SUPPORT */
|
||||||
unsigned int :1; /* 1 bit of padding to round out to 8 bits */
|
|
||||||
|
|
||||||
#if PPP_AUTH_SUPPORT
|
#if PPP_AUTH_SUPPORT
|
||||||
/* auth data */
|
/* auth data */
|
||||||
@ -415,9 +419,7 @@ struct ppp_pcb_s {
|
|||||||
ccp_options ccp_gotoptions; /* what the peer agreed to do */
|
ccp_options ccp_gotoptions; /* what the peer agreed to do */
|
||||||
ccp_options ccp_allowoptions; /* what we'll agree to do */
|
ccp_options ccp_allowoptions; /* what we'll agree to do */
|
||||||
ccp_options ccp_hisoptions; /* what we agreed to do */
|
ccp_options ccp_hisoptions; /* what we agreed to do */
|
||||||
int ccp_localstate; /* Local state (mainly for handling reset-reqs and reset-acks). */
|
u8_t ccp_localstate; /* Local state (mainly for handling reset-reqs and reset-acks). */
|
||||||
int all_rejected; /* we rejected all peer's options */
|
|
||||||
|
|
||||||
#if MPPE_SUPPORT
|
#if MPPE_SUPPORT
|
||||||
ppp_mppe_state mppe_comp; /* MPPE "compressor" structure */
|
ppp_mppe_state mppe_comp; /* MPPE "compressor" structure */
|
||||||
ppp_mppe_state mppe_decomp; /* MPPE "decompressor" structure */
|
ppp_mppe_state mppe_decomp; /* MPPE "decompressor" structure */
|
||||||
|
@ -546,7 +546,7 @@ static void ccp_resetci(fsm *f) {
|
|||||||
#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT */
|
#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT */
|
||||||
|
|
||||||
*go = *wo;
|
*go = *wo;
|
||||||
pcb->all_rejected = 0;
|
pcb->ccp_all_rejected = 0;
|
||||||
|
|
||||||
#if MPPE_SUPPORT
|
#if MPPE_SUPPORT
|
||||||
if (go->mppe) {
|
if (go->mppe) {
|
||||||
@ -1023,7 +1023,7 @@ static int ccp_rejci(fsm *f, u_char *p, int len) {
|
|||||||
* Cope with empty configure-rejects by ceasing to send
|
* Cope with empty configure-rejects by ceasing to send
|
||||||
* configure-requests.
|
* configure-requests.
|
||||||
*/
|
*/
|
||||||
if (len == 0 && pcb->all_rejected)
|
if (len == 0 && pcb->ccp_all_rejected)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if MPPE_SUPPORT
|
#if MPPE_SUPPORT
|
||||||
@ -1374,7 +1374,7 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) {
|
|||||||
|
|
||||||
if (ret != CONFACK) {
|
if (ret != CONFACK) {
|
||||||
if (ret == CONFREJ && *lenp == retp - p0)
|
if (ret == CONFREJ && *lenp == retp - p0)
|
||||||
pcb->all_rejected = 1;
|
pcb->ccp_all_rejected = 1;
|
||||||
else
|
else
|
||||||
*lenp = retp - p0;
|
*lenp = retp - p0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user