]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
5 years agohome_server may be NULL if proxying fails
Alan T. DeKok [Wed, 20 Nov 2019 13:30:42 +0000 (08:30 -0500)] 
home_server may be NULL if proxying fails

5 years agoIncrease the 'nasportid' SQL field for 'varchar(30)' #3141
Jorge Pereira [Tue, 19 Nov 2019 20:02:04 +0000 (17:02 -0300)] 
Increase the 'nasportid' SQL field for 'varchar(30)' #3141

5 years agouse fr_allocate instead of sp_allocate
Alan T. DeKok [Tue, 19 Nov 2019 19:58:47 +0000 (14:58 -0500)] 
use fr_allocate instead of sp_allocate

so anyone rooting thru the list of stored procedures knows that
it's a FR function

5 years agoPostgreSQL sqlippools: Find and allocate stored procedure
Terry Burton [Mon, 18 Nov 2019 02:38:30 +0000 (02:38 +0000)] 
PostgreSQL sqlippools: Find and allocate stored procedure

Replace existing stored procedure with one that combines the
allocate_find and allocate_update queries.

We can additionally avoid round trips by avoiding BEGIN and COMMIT since
calling an SP provides a new transaction context [*]. Therefore the IP
allocation process is reduced to running a single statement.

Indicative performance testing showed increased IP allocation
performance from 120 allocs/sec with separate queries to 1500 allocs/sec
on a two-node master/slave cluster.

[*] Verfied as follows which indicates that we are within a transaction
rather than "autocommit"ing:

  > CREATE OR REPLACE FUNCTION sp_txid ()
  RETURNS text
  LANGUAGE plpgsql
  AS $$
  DECLARE
  BEGIN
    -- Write the current txid to a table
    INSERT INTO txids SELECT txid_current();
    INSERT INTO txids SELECT txid_current();
    RETURN txid_current();
  END$$;

  > CREATE TEMPORARY TABLE txids (txid TEXT);

  > SELECT sp_txid();
  txsp_txid = 651120
  > SELECT sp_txid();
  txsp_txid = 651121

  > SELECT * FROM txids
  txids
  -------
  651120
  651120
  651121
  651121

5 years agotypo
Matthew Newton [Tue, 19 Nov 2019 10:33:52 +0000 (10:33 +0000)] 
typo

5 years agoFix permissions of certs in bootstrap fallback. ref #3132
Jorge Pereira [Mon, 18 Nov 2019 15:43:29 +0000 (12:43 -0300)] 
Fix permissions of certs in bootstrap fallback. ref #3132

5 years agouse something that actually works
Matthew Newton [Sat, 16 Nov 2019 00:24:58 +0000 (00:24 +0000)] 
use something that actually works

5 years agoupdate dist-check
Matthew Newton [Fri, 15 Nov 2019 00:51:49 +0000 (00:51 +0000)] 
update dist-check

5 years agoBump for 3.0.21
Matthew Newton [Fri, 15 Nov 2019 00:51:14 +0000 (00:51 +0000)] 
Bump for 3.0.21

5 years agoprepare for 3.0.20 release release_3_0_20
Matthew Newton [Thu, 14 Nov 2019 17:08:23 +0000 (17:08 +0000)] 
prepare for 3.0.20 release

5 years agoParameterise jenkinsfile
Matthew Newton [Wed, 13 Nov 2019 21:51:44 +0000 (21:51 +0000)] 
Parameterise jenkinsfile

5 years agouse the correct OID
Alan T. DeKok [Mon, 11 Nov 2019 19:25:07 +0000 (14:25 -0500)] 
use the correct OID

5 years agowhitespace
Matthew Newton [Mon, 11 Nov 2019 23:24:52 +0000 (23:24 +0000)] 
whitespace

5 years agoSplit jenkinsfile so we can use the functions elsewhere
Matthew Newton [Mon, 11 Nov 2019 21:20:46 +0000 (21:20 +0000)] 
Split jenkinsfile so we can use the functions elsewhere

5 years agohandle is already nonnull
Matthew Newton [Mon, 11 Nov 2019 11:13:35 +0000 (11:13 +0000)] 
handle is already nonnull

5 years agopossibly unused variable
Matthew Newton [Mon, 11 Nov 2019 11:08:03 +0000 (11:08 +0000)] 
possibly unused variable

5 years agotypos
Alan T. DeKok [Mon, 11 Nov 2019 00:21:25 +0000 (19:21 -0500)] 
typos

5 years agoremove dup
Alan T. DeKok [Mon, 11 Nov 2019 00:20:47 +0000 (19:20 -0500)] 
remove dup

5 years agonote recent changes
Alan T. DeKok [Mon, 11 Nov 2019 00:20:29 +0000 (19:20 -0500)] 
note recent changes

5 years agoadd example of NAIRealm from RFC 7585
Alan T. DeKok [Mon, 11 Nov 2019 00:04:06 +0000 (19:04 -0500)] 
add example of NAIRealm from RFC 7585

5 years agoremove unused function
Alan T. DeKok [Sun, 10 Nov 2019 14:19:25 +0000 (09:19 -0500)] 
remove unused function

5 years agoEAP-pwd: fix DoS due to multithreaded BN_CTX access
Mathy Vanhoef [Fri, 4 Oct 2019 13:53:52 +0000 (17:53 +0400)] 
EAP-pwd: fix DoS due to multithreaded BN_CTX access

The EAP-pwd module created one global OpenSSL BN_CTX instance, and
used this instance in all incoming requests. This means that different
threads used the same BN_CTX instance, which can result in a crash.
An adversary can trigger these crashes by concurrently initiating
multiple EAP-pwd handshakes from different clients.

Fix this bug by creating a separate BN_CTX instance for each request.

6 years agoradsqlrelay changes backported to v3.0.x (#3112)
Terry Burton [Fri, 8 Nov 2019 21:02:09 +0000 (21:02 +0000)] 
radsqlrelay changes backported to v3.0.x (#3112)

* radsqlrelay: actually do something in debug mode

* radsqlrelay systemd watchdog (#2922)

* radsqlrelay: Clean up strict and warnings pragmas

The modules we use are clean so ensure that these pragmas apply to
includes.

* radsqlrelay: Add support for systemd watchdogs

systemd can terminate (and restart) the service if it stops providing
watchdogs for a defined interval.

* radsqlrelay: Don't get stuck processing the same broken SQL statements

If the file contains a broken SQL statement then it is continually
retried with a 1 sec delay.

Restarting the radsqlrelay will replay the entire file (which could get
stuck even earlier due to duplicate key fields).

We instead continue when we encounter a failing statement unless the
failure was the result of a database disconnect in which case it is
resumed once the connection is available.

6 years agoadd missing backslash
Alan T. DeKok [Thu, 7 Nov 2019 22:01:27 +0000 (17:01 -0500)] 
add missing backslash

6 years agomschap: whitespace, minor typos
Matthew Newton [Wed, 6 Nov 2019 16:24:44 +0000 (16:24 +0000)] 
mschap: whitespace, minor typos

6 years agomschap: fix up comments
Matthew Newton [Wed, 6 Nov 2019 16:19:36 +0000 (16:19 +0000)] 
mschap: fix up comments

6 years agoAdd jenkins test repo dockerfiles
Matthew Newton [Tue, 5 Nov 2019 15:05:25 +0000 (15:05 +0000)] 
Add jenkins test repo dockerfiles

6 years agoAdd debian10 and centos8 to Jenkins build
Matthew Newton [Tue, 5 Nov 2019 15:01:43 +0000 (15:01 +0000)] 
Add debian10 and centos8 to Jenkins build

6 years agoAdd centos8 Dockerfile
Matthew Newton [Tue, 5 Nov 2019 13:00:24 +0000 (13:00 +0000)] 
Add centos8 Dockerfile

6 years agoRPM spec dependencies for RHEL8
Matthew Newton [Tue, 5 Nov 2019 12:58:39 +0000 (12:58 +0000)] 
RPM spec dependencies for RHEL8

6 years agonotes on altnames
Alan T. DeKok [Mon, 4 Nov 2019 20:40:30 +0000 (15:40 -0500)] 
notes on altnames

6 years agomore of the same
Alan T. DeKok [Mon, 4 Nov 2019 20:26:07 +0000 (15:26 -0500)] 
more of the same

6 years agonotes on iOS 13
Alan T. DeKok [Mon, 4 Nov 2019 20:22:58 +0000 (15:22 -0500)] 
notes on iOS 13

6 years agoadd support for "insert"
Alan T. DeKok [Fri, 1 Nov 2019 00:19:12 +0000 (20:19 -0400)] 
add support for "insert"

6 years agonote findOne
Alan T. DeKok [Fri, 1 Nov 2019 00:05:18 +0000 (20:05 -0400)] 
note findOne

6 years agonote recent changes
Alan T. DeKok [Fri, 1 Nov 2019 00:04:31 +0000 (20:04 -0400)] 
note recent changes

6 years agoadd support for "findOne"
Alan T. DeKok [Fri, 1 Nov 2019 00:03:00 +0000 (20:03 -0400)] 
add support for "findOne"

6 years agoPYTHON_BIN -> PYTHON3_BIN so configure doesn't pull the wrong value from cache
Aren Sandersen [Wed, 23 Oct 2019 00:03:27 +0000 (00:03 +0000)] 
PYTHON_BIN -> PYTHON3_BIN so configure doesn't pull the wrong value from cache

6 years agoAdd python3-dev to travis env
Aren Sandersen [Tue, 22 Oct 2019 23:02:19 +0000 (16:02 -0700)] 
Add python3-dev to travis env

6 years agoFix the errors identified by LGTM
Aren Sandersen [Tue, 22 Oct 2019 22:31:32 +0000 (15:31 -0700)] 
Fix the errors identified by LGTM

6 years agoCreate a separate rlm_python3 module.
Aren Sandersen [Fri, 17 May 2019 18:18:40 +0000 (11:18 -0700)] 
Create a separate rlm_python3 module.

6 years agoinitialize result from the stack. Fixes #3082
Alan T. DeKok [Thu, 31 Oct 2019 14:19:20 +0000 (10:19 -0400)] 
initialize result from the stack.  Fixes #3082

I sincerely hope that this change doesn't affect anything else
:(

6 years agoUpdate the hardware-type list
Jorge Pereira [Thu, 24 Oct 2019 20:23:11 +0000 (17:23 -0300)] 
Update the hardware-type list

It was extracted from the latest content from
https://www.iana.org/assignments/arp-parameters/arp-parameters.xhtml

Last Updated: 2016-07-20

6 years agoif there's no reply yet, return NULL
Alan T. DeKok [Thu, 24 Oct 2019 15:22:09 +0000 (11:22 -0400)] 
if there's no reply yet, return NULL

6 years agodon't overrun fr_packet_codes[] array
Alan T. DeKok [Thu, 24 Oct 2019 15:05:26 +0000 (11:05 -0400)] 
don't overrun fr_packet_codes[] array

6 years agodon't call memcpy() with a zero-length argument
Alan T. DeKok [Wed, 23 Oct 2019 12:53:40 +0000 (08:53 -0400)] 
don't call memcpy() with a zero-length argument

it won't do anything, but it's good to check.

6 years agomanual merge of commit 3495a8cef
Alan T. DeKok [Tue, 22 Oct 2019 19:40:45 +0000 (15:40 -0400)] 
manual merge of commit 3495a8cef

6 years agoadd now about --allow-mschapv2
Alan T. DeKok [Mon, 21 Oct 2019 13:08:15 +0000 (09:08 -0400)] 
add now about --allow-mschapv2

6 years agodon't do locking on files in /dev. Closes #3057
Alan T. DeKok [Sat, 19 Oct 2019 11:57:48 +0000 (07:57 -0400)] 
don't do locking on files in /dev.  Closes #3057

6 years agonote recent changes
Alan T. DeKok [Wed, 16 Oct 2019 20:41:45 +0000 (16:41 -0400)] 
note recent changes

6 years agoupdates and word smithing
Alan T. DeKok [Wed, 16 Oct 2019 13:42:00 +0000 (09:42 -0400)] 
updates and word smithing

and move CoA attributes to internal dictionary, which simplifies
it a bit.

6 years agoMerge pull request #3045 from terryburton/v3.0.x-coa-relay-example-site
Alan DeKok [Wed, 16 Oct 2019 13:17:04 +0000 (09:17 -0400)] 
Merge pull request #3045 from terryburton/v3.0.x-coa-relay-example-site

Example coa-relay site

6 years agoMerge pull request #3048 from terryburton/v3.0.x-mysql-sp
Alan DeKok [Wed, 16 Oct 2019 13:16:47 +0000 (09:16 -0400)] 
Merge pull request #3048 from terryburton/v3.0.x-mysql-sp

MySQL sqlippools: Find and allocate stored procedure

6 years agoMerge pull request #3052 from jpereira/v3/fix-mongo-aggregate
Alan DeKok [Tue, 15 Oct 2019 23:29:46 +0000 (19:29 -0400)] 
Merge pull request #3052 from jpereira/v3/fix-mongo-aggregate

Fix compiler complaint

6 years agoFix compiler complaint 3052/head
Jorge Pereira [Tue, 15 Oct 2019 20:25:18 +0000 (17:25 -0300)] 
Fix compiler complaint

6 years agoAdd example coa-relay site 3045/head
Terry Burton [Sat, 12 Oct 2019 19:33:07 +0000 (20:33 +0100)] 
Add example coa-relay site

6 years agoupdate file time when they change. Fixes #2846
Alan T. DeKok [Tue, 15 Oct 2019 13:12:14 +0000 (09:12 -0400)] 
update file time when they change.  Fixes #2846

6 years agonote recent changes
Alan T. DeKok [Tue, 15 Oct 2019 12:21:26 +0000 (08:21 -0400)] 
note recent changes

6 years agoMySQL sqlippools: Find and allocate stored procedure 3048/head
Terry Burton [Mon, 14 Oct 2019 22:09:09 +0000 (23:09 +0100)] 
MySQL sqlippools: Find and allocate stored procedure

6 years agodon't add extraneous {}
Alan T. DeKok [Mon, 14 Oct 2019 15:34:09 +0000 (11:34 -0400)] 
don't add extraneous {}

6 years agotry to quiet compiler warnings
Alan T. DeKok [Sat, 12 Oct 2019 22:33:12 +0000 (18:33 -0400)] 
try to quiet compiler warnings

6 years agoalways set the correct virtual server for post_proxy, too
Alan T. DeKok [Sat, 12 Oct 2019 21:26:10 +0000 (17:26 -0400)] 
always set the correct virtual server for post_proxy, too

6 years agoalways set the correct virtual server for pre_proxy
Alan T. DeKok [Sat, 12 Oct 2019 21:22:07 +0000 (17:22 -0400)] 
always set the correct virtual server for pre_proxy

6 years agoclear our error so we don't print it.
Alan T. DeKok [Sat, 12 Oct 2019 21:20:26 +0000 (17:20 -0400)] 
clear our error so we don't print it.

If we're printing an error due to packet mismatch, then there's
no error from the library, and fr_strerror() should return nothing.

6 years agorun through the formatting script
Alan T. DeKok [Fri, 11 Oct 2019 16:22:44 +0000 (12:22 -0400)] 
run through the formatting script

6 years agoMerge pull request #3039 from fdurand/dictionary/airspace
Alan DeKok [Fri, 11 Oct 2019 16:22:02 +0000 (12:22 -0400)] 
Merge pull request #3039 from fdurand/dictionary/airspace

New bandwidth rate-limits airspace attributes

6 years agoNew airspace attributes 3039/head
Durand Fabrice [Thu, 10 Oct 2019 01:05:14 +0000 (21:05 -0400)] 
New airspace attributes
(https://community.cisco.com/t5/policy-and-access/freeradius-with-wlc-8-3-122-per-user-bandwidth-rate-limits/td-p/3839617)

6 years agonote recent changes
Alan T. DeKok [Mon, 7 Oct 2019 17:46:59 +0000 (13:46 -0400)] 
note recent changes

6 years agodon't use parent listener in child CoA
Alan T. DeKok [Mon, 7 Oct 2019 17:42:04 +0000 (13:42 -0400)] 
don't use parent listener in child CoA

6 years agoDon't jump over group and profile checks
Matthew Newton [Fri, 4 Oct 2019 10:14:35 +0000 (11:14 +0100)] 
Don't jump over group and profile checks

It means we're inconsistent in warning messages depending on
whether radreply entry was found or not. rlm_sql_process_groups()
already checks group_membership_query.

6 years agoFix the error message for 'uknown address family' (#3005)
Jorge Pereira [Fri, 20 Sep 2019 23:00:04 +0000 (20:00 -0300)] 
Fix the error message for 'uknown address family' (#3005)

6 years agonote recent changes (#3004)
Jorge Pereira [Fri, 20 Sep 2019 13:58:56 +0000 (10:58 -0300)] 
note recent changes (#3004)

6 years agoSync dictionary.aptilo with latest official dictionary
Marcus Sundberg [Fri, 20 Sep 2019 10:14:55 +0000 (12:14 +0200)] 
Sync dictionary.aptilo with latest official dictionary

6 years agofix last commit and create useful error messages
Alan T. DeKok [Fri, 20 Sep 2019 13:07:08 +0000 (09:07 -0400)] 
fix last commit and create useful error messages

6 years agomanually backport master changes (#3001)
Matt Rose [Wed, 18 Sep 2019 16:34:06 +0000 (12:34 -0400)] 
manually backport master changes (#3001)

6 years agoevent_new_fd() doesn't need to return anything
Alan T. DeKok [Wed, 18 Sep 2019 16:32:28 +0000 (12:32 -0400)] 
event_new_fd() doesn't need to return anything

6 years agoshut up stupid compiler
Alan T. DeKok [Wed, 18 Sep 2019 16:28:49 +0000 (12:28 -0400)] 
shut up stupid compiler

6 years agonote recent changes
Alan T. DeKok [Wed, 18 Sep 2019 13:49:59 +0000 (09:49 -0400)] 
note recent changes

6 years agoallow support for ENV
Alan T. DeKok [Wed, 18 Sep 2019 13:41:01 +0000 (09:41 -0400)] 
allow support for ENV

6 years agoset User here, too
Alan T. DeKok [Mon, 16 Sep 2019 13:04:49 +0000 (09:04 -0400)] 
set User here, too

6 years agoforce user/group to be radiusd
Alan T. DeKok [Mon, 16 Sep 2019 13:02:45 +0000 (09:02 -0400)] 
force user/group to be radiusd

6 years agoremove chown.
Alan T. DeKok [Mon, 16 Sep 2019 11:32:50 +0000 (07:32 -0400)] 
remove chown.

It's not needed according to the Systemd documentation

---
RuntimeDirectory=foo/bar baz
the service manager creates /run/foo (if it does not exist), /run/foo/bar, and /run/baz. The directories /run/foo/bar and /run/baz except /run/foo are owned by the user and group specified in User= and Group=, and removed when the service is stopped.
---

6 years agoAdd *.crl to .gitignore (#2983)
Jorge Pereira [Fri, 13 Sep 2019 13:39:42 +0000 (10:39 -0300)] 
Add *.crl to .gitignore (#2983)

6 years agoerrors are errors
Jorge Pereira [Tue, 10 Sep 2019 20:47:36 +0000 (17:47 -0300)] 
errors are errors

6 years agoUse correct CA password when not the default "whatever" #2963
Jorge Pereira [Mon, 9 Sep 2019 15:38:05 +0000 (12:38 -0300)] 
Use correct CA password when not the default "whatever" #2963

6 years agocreate an initial, empty CRL in DER encoding
Stefan Winter [Mon, 9 Sep 2019 12:51:36 +0000 (14:51 +0200)] 
create an initial, empty CRL in DER encoding

If a user wants to deploy his CA, the URL in crlDistributionPoints should actually contain a DER-encoded CRL file. We create it here; the admin still needs to actually deploy the file at the URL chosen.

6 years agomongo: Fix examples
Daniele Rondina [Thu, 5 Sep 2019 14:17:41 +0000 (16:17 +0200)] 
mongo: Fix examples

ObjectId() and Date() commands are not accepted by the low-level
mongo JSON engine.
For the field 'date' it's needed to use $date command.
For replacing ObjectId() it is possible to use sha256 or any others
hashing command.

6 years agoremove references to rlm_sql_log
Alan T. DeKok [Tue, 3 Sep 2019 11:26:20 +0000 (07:26 -0400)] 
remove references to rlm_sql_log

6 years agoREADME: fix link to Network RADIUS ref #2945
Jorge Pereira [Mon, 2 Sep 2019 19:26:07 +0000 (16:26 -0300)] 
README: fix link to Network RADIUS ref #2945

6 years agoradmin: Add support to keep the history in ~/.radmin_history
Jorge Pereira [Fri, 30 Aug 2019 22:12:37 +0000 (19:12 -0300)] 
radmin: Add support to keep the history in ~/.radmin_history

6 years agodon't bury documentation on sql_user_name
Alan T. DeKok [Sun, 1 Sep 2019 20:03:27 +0000 (16:03 -0400)] 
don't bury documentation on sql_user_name

6 years agonote recent changes
Alan T. DeKok [Fri, 30 Aug 2019 17:48:34 +0000 (13:48 -0400)] 
note recent changes

6 years agoPostgreSQL: Don't require a lease to have expired if we reallocate it to the previous...
Terry Burton [Wed, 28 Aug 2019 23:33:23 +0000 (00:33 +0100)] 
PostgreSQL: Don't require a lease to have expired if we reallocate it to the previous client

The current default allocate_find query causes per-client IP allocation
instability that starts when allocate_clear rate limiting comes into effect.

With initial pool conditions the default alloc_find query selects from the pool
of all *expired* leases. It selects the least recently used IP address (i.e.
the one with the oldest expiry_time) unless a matching username and/or
callingstationid exists in the table in which case these are prioritised in
order to issue the client with their previous lease. Normally picking the least
recently used address helps to avoid issuing the address to a different client,
maximising the chance of stickiness, which is desirable.

However, if a user makes successive authentication attempts whilst
allocate_clear rate limiting is active they are always allocated a different IP
address because their existing address is unavailable (has not yet expired and
has not been explicitly expired by allocate_clear), with the effect that there
are now multiple rows in the table containing the same pool_key, username and
callingstationid.

The normal ordering then has the undesirable effect of ensuring that successive
future IP address selections for the client will flip-flop between addresses
because username + callingstationid are first prioritied then the *oldest
expiry_time* is chosen (rather than the most recent expiry relating to the most
recent lease). This behaviour persists once allocate_clear rate limiting is no
longer in effect.

We can avoid getting having multiple rows with the same client details by
amending the allocate_find query to include an existing row matching
nasipaddress and pool_key in the available set of IP addreses regardless of
whether the lease has expired or not (i.e. re-allocation of a current lease to
the same client).

6 years agoMySQL: Don't require a lease to have expired if we reallocate it to the previous...
Terry Burton [Fri, 30 Aug 2019 14:58:12 +0000 (15:58 +0100)] 
MySQL: Don't require a lease to have expired if we reallocate it to the previous client

The current default allocate_find query causes per-client IP allocation
instability that starts when allocate_clear rate limiting comes into
effect.

With initial pool conditions the default alloc_find query selects from
the pool of all *expired* leases. It selects the least recently used IP
address (i.e. the one with the oldest expiry_time) unless a matching
username and/or callingstationid exists in the table in which case these
are prioritised in order to issue the client with their previous lease.
Normally picking the least recently used address helps to avoid issuing
the address to a different client, maximising the chance of stickiness,
which is desirable.

However, if a user makes successive authentication attempts whilst
allocate_clear rate limiting is active they are always allocated a
different IP address because their existing address is unavailable (has
not yet expired and has not been explicitly expired by allocate_clear),
with the effect that there are now multiple rows in the table containing
the same pool_key, username and callingstationid.

The normal ordering then has the undesirable effect of ensuring that
successive future IP address selections for the client will flip-flop
between addresses because username + callingstationid are first
prioritied then the *oldest expiry_time* is chosen (rather than the most
recent expiry relating to the most recent lease). This behaviour
persists once allocate_clear rate limiting is no longer in effect.

We can avoid getting having multiple rows with the same client details
by amending the allocate_find query to include an existing row matching
nasipaddress and pool_key in the available set of IP addreses regardless
of whether the lease has expired or not (i.e. re-allocation of a current
lease to the same client).

6 years agoOracle: Don't require a lease to have expired if we reallocate it to the previous...
Terry Burton [Fri, 30 Aug 2019 14:58:48 +0000 (15:58 +0100)] 
Oracle: Don't require a lease to have expired if we reallocate it to the previous client

The current default allocate_find query causes per-client IP allocation
instability that starts when allocate_clear rate limiting comes into
effect.

With initial pool conditions the default alloc_find query selects from
the pool of all *expired* leases. It selects the least recently used IP
address (i.e. the one with the oldest expiry_time) unless a matching
username and/or callingstationid exists in the table in which case these
are prioritised in order to issue the client with their previous lease.
Normally picking the least recently used address helps to avoid issuing
the address to a different client, maximising the chance of stickiness,
which is desirable.

However, if a user makes successive authentication attempts whilst
allocate_clear rate limiting is active they are always allocated a
different IP address because their existing address is unavailable (has
not yet expired and has not been explicitly expired by allocate_clear),
with the effect that there are now multiple rows in the table containing
the same pool_key, username and callingstationid.

The normal ordering then has the undesirable effect of ensuring that
successive future IP address selections for the client will flip-flop
between addresses because username + callingstationid are first
prioritied then the *oldest expiry_time* is chosen (rather than the most
recent expiry relating to the most recent lease). This behaviour
persists once allocate_clear rate limiting is no longer in effect.

We can avoid getting having multiple rows with the same client details
by amending the allocate_find query to include an existing row matching
nasipaddress and pool_key in the available set of IP addreses regardless
of whether the lease has expired or not (i.e. re-allocation of a current
lease to the same client).

6 years agoSQLite: Don't require a lease to have expired if we reallocate it to the previous...
Terry Burton [Fri, 30 Aug 2019 14:59:16 +0000 (15:59 +0100)] 
SQLite: Don't require a lease to have expired if we reallocate it to the previous client

The current default allocate_find query causes per-client IP allocation
instability that starts when allocate_clear rate limiting comes into
effect.

With initial pool conditions the default alloc_find query selects from
the pool of all *expired* leases. It selects the least recently used IP
address (i.e. the one with the oldest expiry_time) unless a matching
username and/or callingstationid exists in the table in which case these
are prioritised in order to issue the client with their previous lease.
Normally picking the least recently used address helps to avoid issuing
the address to a different client, maximising the chance of stickiness,
which is desirable.

However, if a user makes successive authentication attempts whilst
allocate_clear rate limiting is active they are always allocated a
different IP address because their existing address is unavailable (has
not yet expired and has not been explicitly expired by allocate_clear),
with the effect that there are now multiple rows in the table containing
the same pool_key, username and callingstationid.

The normal ordering then has the undesirable effect of ensuring that
successive future IP address selections for the client will flip-flop
between addresses because username + callingstationid are first
prioritied then the *oldest expiry_time* is chosen (rather than the most
recent expiry relating to the most recent lease). This behaviour
persists once allocate_clear rate limiting is no longer in effect.

We can avoid getting having multiple rows with the same client details
by amending the allocate_find query to include an existing row matching
nasipaddress and pool_key in the available set of IP addreses regardless
of whether the lease has expired or not (i.e. re-allocation of a current
lease to the same client).

6 years agofall through if there's no error
Alan T. DeKok [Fri, 30 Aug 2019 15:36:45 +0000 (11:36 -0400)] 
fall through if there's no error

6 years agodoxygen
Alan T. DeKok [Fri, 30 Aug 2019 15:01:15 +0000 (11:01 -0400)] 
doxygen

6 years agonote recent changes
Alan T. DeKok [Fri, 30 Aug 2019 14:40:17 +0000 (10:40 -0400)] 
note recent changes

6 years agoUse SSL_is_init_finished instead of checking the last handshake_type
Matthew Newton [Mon, 28 Jan 2019 17:44:03 +0000 (17:44 +0000)] 
Use SSL_is_init_finished instead of checking the last handshake_type

Backport of d90c4bf807 from master