Skip to content

Commit

Permalink
Merge pull request pine64#28 from BKPepe/more-pppd-backports
Browse files Browse the repository at this point in the history
More ppp backports
  • Loading branch information
gamelaster authored Oct 29, 2020
2 parents dfc40a7 + e2b52c1 commit 435dd2b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions components/network/lwip/src/netif/ppp/eap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,12 @@ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) {
int fd;
#endif /* USE_SRP */

/*
* Ignore requests if we're not open
*/
if (esp->es_client.ea_state <= eapClosed)
return;

/*
* Note: we update es_client.ea_id *only if* a Response
* message is being generated. Otherwise, we leave it the
Expand Down Expand Up @@ -1737,6 +1743,12 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) {
u_char dig[SHA_DIGESTSIZE];
#endif /* USE_SRP */

/*
* Ignore responses if we're not open
*/
if (esp->es_server.ea_state <= eapClosed)
return;

if (pcb->eap.es_server.ea_id != id) {
ppp_dbglog("EAP: discarding Response %d; expected ID %d", id,
pcb->eap.es_server.ea_id);
Expand Down Expand Up @@ -2043,6 +2055,12 @@ static void eap_success(ppp_pcb *pcb, u_char *inp, int id, int len) {
static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) {
LWIP_UNUSED_ARG(id);

/*
* Ignore responses if we're not open
*/
if (esp->es_client.ea_state <= eapClosed)
return;

if (!eap_client_active(pcb)) {
ppp_dbglog("EAP unexpected failure message in state %s (%d)",
eap_state_name(pcb->eap.es_client.ea_state),
Expand Down
3 changes: 2 additions & 1 deletion components/network/lwip/src/netif/ppp/ipv6cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static void ipv6cp_init(ppp_pcb *pcb) {
memset(ao, 0, sizeof(*ao));
#endif /* 0 */

wo->accept_local = 1;
wo->accept_local = 0;
wo->neg_ifaceid = 1;
ao->neg_ifaceid = 1;

Expand Down Expand Up @@ -515,6 +515,7 @@ static void ipv6cp_resetci(fsm *f) {
wo->req_ifaceid = wo->neg_ifaceid && ao->neg_ifaceid;

if (!wo->opt_local) {
wo->accept_local = 1;
eui64_magic_nz(wo->ourid);
}

Expand Down

0 comments on commit 435dd2b

Please sign in to comment.