// L2TPNS PPP Stuff
-char const *cvs_id_ppp = "$Id: ppp.c,v 1.73 2005/08/12 14:12:28 bodea Exp $";
+char const *cvs_id_ppp = "$Id: ppp.c,v 1.75 2005/08/24 23:44:08 bodea Exp $";
#include <stdio.h>
#include <string.h>
CSTAT(processchap);
LOG_HEX(5, "CHAP", p, l);
- r = sess_local[s].radius;
- if (!r)
- {
- LOG(1, s, t, "Unexpected CHAP message\n");
- STAT(tunnel_rx_errors);
- return;
- }
if (l < 4)
{
return;
}
+ r = sess_local[s].radius;
+ if (!r)
+ {
+ LOG(3, s, t, "Unexpected CHAP message\n");
+ return;
+ }
+
if (session[s].ppp.phase != Authenticate)
{
LOG(2, s, t, "CHAP ignored in %s phase\n", ppp_phase(session[s].ppp.phase));
addr = htonl(session[s].ip);
if (memcmp(o + 2, &addr, (sizeof addr)))
{
+ uint8_t *oq = q;
q = ppp_nak(s, b, sizeof(b), PPPIPCP, &response, q, p, o, (uint8_t *) &addr, sizeof(addr));
- if (!q || *response == ConfigRej)
+ if (!q || (q != oq && *response == ConfigRej))
{
sessionshutdown(s, "Can't negotiate IPCP.", 3, 0);
return;