// Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced
// vim: sw=8 ts=8
-char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.98 2005-05-07 11:57:53 bodea Exp $";
+char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.100 2005-05-09 20:48:00 bodea Exp $";
#include <arpa/inet.h>
#include <assert.h>
{
uint16_t atype = ntohs(*(uint16_t *)b);
LOG(4, s, t, " Proxy Auth Type %d (%s)\n", atype, auth_type(atype));
- if (atype = 2)
+ if (atype == 2)
authtype = AUTHCHAP;
else if (atype == 3)
authtype = AUTHPAP;
controlnull(t); // ack
// proxy authentication type is not supported
if (authtype && !(config->radius_authtypes & authtype))
- initlcp(t, s);
+ sendlcp(t, s, config->radius_authprefer);
break;
case 14: // CDN
controlnull(t); // ack
// test twice, In case someone works with
// a secondary radius server without defining
// a primary one, this will work even then.
- if (i>0 && !config->radiusport[i])
+ if (i > 0 && !config->radiusport[i])
config->radiusport[i] = config->radiusport[i-1];
if (!config->radiusport[i])
config->radiusport[i] = RADPORT;
// parse radius_authtypes_s
config->radius_authtypes = config->radius_authprefer = 0;
p = config->radius_authtypes_s;
- while (*p)
+ while (p && *p)
{
char *s = strpbrk(p, " \t,");
int type = 0;
config->radius_authtypes |= type;
if (!config->radius_authprefer)
config->radius_authprefer = type;
+
+ p = s;
}
if (!config->radius_authtypes)