Alan T. DeKok [Mon, 17 Oct 2011 19:49:08 +0000 (21:49 +0200)]
Release the mutex lock when trying to make a new connection
The DB might be down, and it could take a LONG time to open
a new connection. Instead of holding the mutex lock for long
periods of time, we set a flag saying "spawning", and release
the lock. This lets other threads access the connection pool,
to get open && active connections.
The result is that there are fewer situations where the server
blocks
Alan T. DeKok [Mon, 17 Oct 2011 19:22:09 +0000 (21:22 +0200)]
Add undocumented "lazy init" configuration.
This allows the connection pool to return on init,
even if it's unable to make any new connections. The result
is that the server can start even when the back-end DB is down.
That's nearly always a bad idea, but it's easy enough to do
with the new connection pool code.
Alan T. DeKok [Mon, 17 Oct 2011 19:18:56 +0000 (21:18 +0200)]
Clean up spare connections on release
This mirrors the "spawn new connections on get" functionality.
Also, remember when we last failed to connect. When that happens,
we continue to use existing connections, but we don't open new
connections for one second. This behavior ensures that incoming
requests will still be processed quickly, even when the back-end
database is down.
Alan T. DeKok [Mon, 17 Oct 2011 14:40:50 +0000 (16:40 +0200)]
Hack to work around race condition
We may give up on a proxied packet (and set proxy_listener = NULL)
just as we're receiving a duplicate packet from the NAS. In that
case, we catch it, and do nothing
John Dennis [Tue, 20 Sep 2011 21:56:22 +0000 (17:56 -0400)]
Always send Message-Authenticator in radtest
Originally Message-Authenticator was introduced to provide message
integrity for EAP messages and originally the Message-Authenticator
attribute was only required for EAP messages.
But then RFC 5080 came along and suggested Message-Authenticator
always be sent as best practice.
Any Access-Request packet that performs authorization checks,
including Call Check, SHOULD contain a Message-Authenticator
attribute.
RFC 5080 then goes on to say:
... server implementations may be configured to require the
presence of a Message-Authenticator attribute in Access-Request
packets. Requests not containing a Message-Authenticator attribute
MAY then be silently discarded.
The raddb/clients.conf has this configuration option to satisfy the
above suggestion in RFC 5080:
require_message_authenticator = no|yes
If require_message_authenticator == yes then non-EAP auth-requests
generated by radtest will fail because currently radtest only supplies
the Message-Authenticator if EAP is being performed. With modern
Radius servers (e.g. FreeRADIUS) there is no harm in providing the
Message-Authenticator attribute for non-EAP packets, in fact it's
actually recommended in RFC 5080.
Therefore radtest should ALWAYS send the Message-Authenticator
attribute. If it's EAP or if the server is configured with
require_message_authenticator it must be present. If those conditions
do not hold it's benign. However if require_message_authenticator is
configured radtest will fail for non-EAP.
When 6ed9727 was merged, else{} in the START case got placed against the
wrong if(). Unlike STOP and ALIVE cases, in START insert comes first,
and we only care if that affects 0 rows. If insert fails and we have to
go for an update, we don't have to check for NOOP because we can assume
the insert failed due to a conflicting row already in the database.
John Dennis [Sun, 18 Sep 2011 07:17:45 +0000 (09:17 +0200)]
Document all command line args & add missing man pages
Go through every installed command and verify:
* There exists a man page for the command, if not create one
* For every command line arg in each command:
- Assure the arg appears in the synopis section of the man page
- Assure the arg is documented in the options section of the man page
- Assure the arg is documented in the "usage" emitted by the command
In addition to the above this patch also does:
* Clean up captitalization & the use of terminating periods.
* Removed superfluous unused l option from the getopt format string
of radwho
* Remove rlm_ippool_tool.pod, superseded by rlm_ippool_tool.8 man page