LCP: accept an auth nack to CHAP with length == 4

It seems at least some products send this:

 {LCP (0xc021), length 12: LCP, Conf-Nack (0x03), id 9, length 10
        encoded length 8 (=Option(s) length 4)
        0x0000:  c021 0309 0008
          Auth-Prot Option (0x03), length 4: CHAP[|lcp]}

If we refuse to nack to CHAP, we'd stay stuck with PAP and eventually
get a reject.
This commit is contained in:
Samuel Thibault 2022-12-14 19:08:07 +01:00
parent 4d906e595d
commit af9cb755ab

2
ppp.c
View file

@ -899,7 +899,7 @@ void processlcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
LOG(3, s, t, " Remote requested PAP authentication...%sing\n",
authtype ? "accept" : "reject");
}
else if (proto == PPPCHAP && length > 4 && *(o + 4) == 5)
else if (proto == PPPCHAP && (length == 4 || (length > 4 && *(o + 4) == 5)))
{
authtype = config->radius_authtypes & AUTHCHAP;
LOG(3, s, t, " Remote requested CHAP authentication...%sing\n",