if (state == RADIUSSTOP && radius[r].term_cause)
{
- *p = 49; // acct-terminate-cause
+ *p = 49; // acct-terminate-cause
p[1] = 6;
*(uint32_t *) (p + 2) = htonl(radius[r].term_cause);
p += p[1];
*(uint32_t *) (p + 2) = htonl(s);
p += p[1];
- *p = 6; // Service-Type
+ *p = 6; // Service-Type
p[1] = 6;
*(uint32_t *) (p + 2) = htonl((state == RADIUSJUSTAUTH ? 8 : 2)); // Authenticate only or Framed-User respectevily
p += p[1];
- *p = 7; // Framed-Protocol
+ *p = 7; // Framed-Protocol
p[1] = htonl((state == RADIUSJUSTAUTH ? 0 : 6));
*(uint32_t *) (p + 2) = htonl((state == RADIUSJUSTAUTH ? 0 : 1)); // PPP
p += p[1];
}
else
{
- value = tmp;
+ value = tmp;
len = 0;
}
else if (vendor == 529 && attrib >= 135 && attrib <= 136) // Ascend
{
// handle old-format ascend DNS attributes below
- p += 6;
+ p += 6;
}
else
{
if (*p == 8)
{
// Framed-IP-Address
- if (p[1] < 6) continue;
+ if (p[1] < 6) continue;
session[s].ip = ntohl(*(uint32_t *) (p + 2));
session[s].ip_pool_index = -1;
LOG(3, s, session[s].tunnel, " Radius reply contains IP address %s\n",
else if (*p == 135)
{
// DNS address
- if (p[1] < 6) continue;
+ if (p[1] < 6) continue;
session[s].dns1 = ntohl(*(uint32_t *) (p + 2));
LOG(3, s, session[s].tunnel, " Radius reply contains primary DNS address %s\n",
fmtaddr(htonl(session[s].dns1), 0));
else if (*p == 136)
{
// DNS address
- if (p[1] < 6) continue;
+ if (p[1] < 6) continue;
session[s].dns2 = ntohl(*(uint32_t *) (p + 2));
LOG(3, s, session[s].tunnel, " Radius reply contains secondary DNS address %s\n",
fmtaddr(htonl(session[s].dns2), 0));
}
else if (*p == 11)
{
- // Filter-Id
- char *filter = (char *) p + 2;
+ // Filter-Id
+ char *filter = (char *) p + 2;
int l = p[1] - 2;
char *suffix;
int f;
}
else if (*p == 27)
{
- // Session-Timeout
- if (p[1] < 6) continue;
+ // Session-Timeout
+ if (p[1] < 6) continue;
session[s].session_timeout = ntohl(*(uint32_t *)(p + 2));
LOG(3, s, session[s].tunnel, " Radius reply contains Session-Timeout = %u\n", session[s].session_timeout);
if(!session[s].session_timeout && config->kill_timedout_sessions)
- sessionshutdown(s, "Session timeout is zero", CDN_ADMIN_DISC, 0);
+ sessionshutdown(s, "Session timeout is zero", CDN_ADMIN_DISC, 0);
}
else if (*p == 28)
{
- // Idle-Timeout
- if (p[1] < 6) continue;
+ // Idle-Timeout
+ if (p[1] < 6) continue;
session[s].idle_timeout = ntohl(*(uint32_t *)(p + 2));
LOG(3, s, session[s].tunnel, " Radius reply contains Idle-Timeout = %u\n", session[s].idle_timeout);
}
case CoARequest: // Change of Authorization
if (error)
{
- r_code = CoANAK;
+ r_code = CoANAK;
break;
}