fix RADIUS indexing (should have 16K entries with 64 sockets)
This commit is contained in:
parent
52cb7687d3
commit
af44e3e3bc
5 changed files with 15 additions and 13 deletions
4
Changes
4
Changes
|
|
@ -1,4 +1,4 @@
|
||||||
* Tue May 10 2005 Brendan O'Dea <bod@optusnet.com.au> 2.1.0
|
* Mon May 16 2005 Brendan O'Dea <bod@optusnet.com.au> 2.1.0
|
||||||
- Add IPv6 support from Jonathan McDowell.
|
- Add IPv6 support from Jonathan McDowell.
|
||||||
- Add CHAP support from Jordan Hrycaj.
|
- Add CHAP support from Jordan Hrycaj.
|
||||||
- Add interim accounting support from Vladislav Bjelic.
|
- Add interim accounting support from Vladislav Bjelic.
|
||||||
|
|
@ -61,6 +61,8 @@
|
||||||
- Make "show running-config" a privileged command (contains clear text
|
- Make "show running-config" a privileged command (contains clear text
|
||||||
shared secrets).
|
shared secrets).
|
||||||
- Add sessionctl plugin to provide drop/kill via nsctl.
|
- Add sessionctl plugin to provide drop/kill via nsctl.
|
||||||
|
- Add handling of "throttle=N" RADIUS attributes.
|
||||||
|
- Fix RADIUS indexing (should have 16K entries with 64 sockets).
|
||||||
|
|
||||||
* Fri Dec 17 2004 Brendan O'Dea <bod@optusnet.com.au> 2.0.13
|
* Fri Dec 17 2004 Brendan O'Dea <bod@optusnet.com.au> 2.0.13
|
||||||
- Better cluster master collision resolution: keep a counter of state
|
- Better cluster master collision resolution: keep a counter of state
|
||||||
|
|
|
||||||
8
l2tpns.c
8
l2tpns.c
|
|
@ -4,7 +4,7 @@
|
||||||
// Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced
|
// Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced
|
||||||
// vim: sw=8 ts=8
|
// vim: sw=8 ts=8
|
||||||
|
|
||||||
char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.103 2005/05/13 01:29:40 bodea Exp $";
|
char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.104 2005/05/16 04:51:16 bodea Exp $";
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
@ -1566,7 +1566,7 @@ void sendipcp(tunnelidt t, sessionidt s)
|
||||||
if (!q) return;
|
if (!q) return;
|
||||||
|
|
||||||
*q = ConfigReq;
|
*q = ConfigReq;
|
||||||
q[1] = r << RADIUS_SHIFT; // ID, dont care, we only send one type of request
|
q[1] = r >> RADIUS_SHIFT; // ID, dont care, we only send one type of request
|
||||||
*(uint16_t *) (q + 2) = htons(10);
|
*(uint16_t *) (q + 2) = htons(10);
|
||||||
q[4] = 3;
|
q[4] = 3;
|
||||||
q[5] = 6;
|
q[5] = 6;
|
||||||
|
|
@ -1588,7 +1588,7 @@ void sendipcp(tunnelidt t, sessionidt s)
|
||||||
if (!q) return;
|
if (!q) return;
|
||||||
|
|
||||||
*q = ConfigReq;
|
*q = ConfigReq;
|
||||||
q[1] = r << RADIUS_SHIFT; // ID, don't care, we
|
q[1] = r >> RADIUS_SHIFT; // ID, don't care, we
|
||||||
// only send one type
|
// only send one type
|
||||||
// of request
|
// of request
|
||||||
*(uint16_t *) (q + 2) = htons(14);
|
*(uint16_t *) (q + 2) = htons(14);
|
||||||
|
|
@ -4005,7 +4005,7 @@ static void update_config()
|
||||||
if (!config->numradiusservers)
|
if (!config->numradiusservers)
|
||||||
LOG(0, 0, 0, "No RADIUS servers defined!\n");
|
LOG(0, 0, 0, "No RADIUS servers defined!\n");
|
||||||
|
|
||||||
config->num_radfds = 2 << RADIUS_SHIFT;
|
config->num_radfds = 1 << RADIUS_SHIFT;
|
||||||
|
|
||||||
// parse radius_authtypes_s
|
// parse radius_authtypes_s
|
||||||
config->radius_authtypes = config->radius_authprefer = 0;
|
config->radius_authtypes = config->radius_authprefer = 0;
|
||||||
|
|
|
||||||
8
l2tpns.h
8
l2tpns.h
|
|
@ -1,5 +1,5 @@
|
||||||
// L2TPNS Global Stuff
|
// L2TPNS Global Stuff
|
||||||
// $Id: l2tpns.h,v 1.68 2005/05/08 07:13:56 bodea Exp $
|
// $Id: l2tpns.h,v 1.69 2005/05/16 04:51:16 bodea Exp $
|
||||||
|
|
||||||
#ifndef __L2TPNS_H__
|
#ifndef __L2TPNS_H__
|
||||||
#define __L2TPNS_H__
|
#define __L2TPNS_H__
|
||||||
|
|
@ -22,9 +22,9 @@
|
||||||
#define MAXSESSION 60000 // could be up to 65535
|
#define MAXSESSION 60000 // could be up to 65535
|
||||||
#define MAXTBFS 6000 // Maximum token bucket filters. Might need up to 2 * session.
|
#define MAXTBFS 6000 // Maximum token bucket filters. Might need up to 2 * session.
|
||||||
|
|
||||||
#define RADIUS_SHIFT 5
|
#define RADIUS_SHIFT 6
|
||||||
#define RADIUS_MASK ((unsigned short)(((unsigned short)~0) >> (16 - RADIUS_SHIFT)))
|
#define RADIUS_MASK ((1 << RADIUS_SHIFT) - 1)
|
||||||
#define MAXRADIUS ((unsigned long)(1L << RADIUS_SHIFT) * 255)
|
#define MAXRADIUS ((1 << (RADIUS_SHIFT + 8)) - 1)
|
||||||
|
|
||||||
#define T_UNDEF (0xffff) // A tunnel ID that won't ever be used. Mark session as undefined.
|
#define T_UNDEF (0xffff) // A tunnel ID that won't ever be used. Mark session as undefined.
|
||||||
#define T_FREE (0) // A tunnel ID that won't ever be used. Mark session as free.
|
#define T_FREE (0) // A tunnel ID that won't ever be used. Mark session as free.
|
||||||
|
|
|
||||||
|
|
@ -43,5 +43,5 @@ rm -rf %{buildroot}
|
||||||
%attr(644,root,root) /usr/share/man/man[58]/*
|
%attr(644,root,root) /usr/share/man/man[58]/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue May 10 2005 Brendan O'Dea <bod@optusnet.com.au> 2.1.0-1
|
* Mon May 16 2005 Brendan O'Dea <bod@optusnet.com.au> 2.1.0-1
|
||||||
- 2.1.0 release, see /usr/share/doc/l2tpns-2.1.0/Changes
|
- 2.1.0 release, see /usr/share/doc/l2tpns-2.1.0/Changes
|
||||||
|
|
|
||||||
6
radius.c
6
radius.c
|
|
@ -1,6 +1,6 @@
|
||||||
// L2TPNS Radius Stuff
|
// L2TPNS Radius Stuff
|
||||||
|
|
||||||
char const *cvs_id_radius = "$Id: radius.c,v 1.30 2005/05/07 08:17:26 bodea Exp $";
|
char const *cvs_id_radius = "$Id: radius.c,v 1.31 2005/05/16 04:51:16 bodea Exp $";
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -163,12 +163,12 @@ void radiussend(uint16_t r, uint8_t state)
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case RADIUSAUTH:
|
case RADIUSAUTH:
|
||||||
b[0] = 1; // access request
|
b[0] = AccessRequest; // access request
|
||||||
break;
|
break;
|
||||||
case RADIUSSTART:
|
case RADIUSSTART:
|
||||||
case RADIUSSTOP:
|
case RADIUSSTOP:
|
||||||
case RADIUSINTERIM:
|
case RADIUSINTERIM:
|
||||||
b[0] = 4; // accounting request
|
b[0] = AccountingRequest; // accounting request
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(0, 0, 0, "Unknown radius state %d\n", state);
|
LOG(0, 0, 0, "Unknown radius state %d\n", state);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue