X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/ec7ce23c79c375acc6a8930fc03dcef76488ba7e..refs/heads/whitespace-fixes:/radius.c diff --git a/radius.c b/radius.c index 4e67e63..faf1791 100644 --- a/radius.c +++ b/radius.c @@ -348,7 +348,7 @@ void radiussend(uint16_t r, uint8_t state) 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]; @@ -379,12 +379,12 @@ void radiussend(uint16_t r, uint8_t state) *(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]; @@ -486,7 +486,7 @@ static void handle_avpair(sessionidt s, uint8_t *avp, int len) } else { - value = tmp; + value = tmp; len = 0; } @@ -646,7 +646,7 @@ void processrad(uint8_t *buf, int len, char socket_index) else if (vendor == 529 && attrib >= 135 && attrib <= 136) // Ascend { // handle old-format ascend DNS attributes below - p += 6; + p += 6; } else { @@ -658,7 +658,7 @@ void processrad(uint8_t *buf, int len, char socket_index) 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", @@ -670,7 +670,7 @@ void processrad(uint8_t *buf, int len, char socket_index) 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)); @@ -678,7 +678,7 @@ void processrad(uint8_t *buf, int len, char socket_index) 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)); @@ -732,8 +732,8 @@ void processrad(uint8_t *buf, int len, char socket_index) } 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; @@ -769,17 +769,17 @@ void processrad(uint8_t *buf, int len, char socket_index) } 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); } @@ -1094,7 +1094,7 @@ void processdae(uint8_t *buf, int len, struct sockaddr_in *addr, int alen, struc case CoARequest: // Change of Authorization if (error) { - r_code = CoANAK; + r_code = CoANAK; break; }