chap: cope with our ack being lost
This commit is contained in:
parent
22f650d828
commit
fa64a8010d
1 changed files with 14 additions and 1 deletions
15
ppp.c
15
ppp.c
|
|
@ -207,7 +207,20 @@ void processchap(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
|
||||||
|
|
||||||
if (session[s].ppp.phase != Authenticate)
|
if (session[s].ppp.phase != Authenticate)
|
||||||
{
|
{
|
||||||
LOG(2, s, t, "CHAP ignored in %s phase\n", ppp_phase(session[s].ppp.phase));
|
if (session[s].ppp.phase == Network)
|
||||||
|
{
|
||||||
|
uint8_t b[MAXETHER];
|
||||||
|
uint8_t *p2;
|
||||||
|
LOG(2, s, t, "CHAP in Network phase, peer probably missed our ack, confirming it\n");
|
||||||
|
p2 = makeppp(b, sizeof(b), 0, 0, s, t, PPPCHAP, 0, 0, 0);
|
||||||
|
if (!p2) return;
|
||||||
|
*p2 = 3; // ack
|
||||||
|
p2[1] = p[1];
|
||||||
|
*(uint16_t *) (p2 + 2) = ntohs(4); // no message
|
||||||
|
tunnelsend(b, (p2 - b) + 4, t); // send it
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LOG(2, s, t, "CHAP ignored in %s phase\n", ppp_phase(session[s].ppp.phase));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue