]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
104 min agoEnable new source port limiting for %radius.sendto.ipaddr() developer/ndptech master
Nick Porter [Thu, 7 Aug 2025 16:39:15 +0000 (17:39 +0100)] 
Enable new source port limiting for %radius.sendto.ipaddr()

Now tested to multiple home servers under load

105 min agoRemove reference to files not in the packages
Nick Porter [Thu, 7 Aug 2025 16:12:57 +0000 (17:12 +0100)] 
Remove reference to files not in the packages

2 hours agocatch pop on running trigger, with empty stack developer/alandekok
Alan T. DeKok [Thu, 7 Aug 2025 15:24:18 +0000 (11:24 -0400)] 
catch pop on running trigger, with empty stack

3 hours agoon TCP EOF, flush all writes, and shut down the BIOs
Alan T. DeKok [Thu, 7 Aug 2025 14:59:17 +0000 (10:59 -0400)] 
on TCP EOF, flush all writes, and shut down the BIOs

3 hours agowe don't need separate read / write BIOs
Alan T. DeKok [Thu, 7 Aug 2025 14:58:53 +0000 (10:58 -0400)] 
we don't need separate read / write BIOs

3 hours agoEOF is not always an error case
Alan T. DeKok [Thu, 7 Aug 2025 14:43:19 +0000 (10:43 -0400)] 
EOF is not always an error case

From the docs:

> If the read direction of the socket has shutdown, then the filter
> also sets EV_EOF in flags, and returns the socket error (if any) in
> fflags. It is possible for EOF to be returned (indicating the
> connection is gone) while there is still data pending in the socket
> buffer.

So we suppress printing an error on normal EOF.  Instead, we just
see if we need to reconnect the socket.

Arguably if the other end closes our read side, we _might_ be able
to write to the socket?  but we could still write to it.

3 hours agocheck corner cases
Alan T. DeKok [Thu, 7 Aug 2025 14:16:09 +0000 (10:16 -0400)] 
check corner cases

we can't starve threads of ports :(

4 hours agojust pass errors through on read / write
Alan T. DeKok [Thu, 7 Aug 2025 12:34:32 +0000 (08:34 -0400)] 
just pass errors through on read / write

the underlying BIO should call fr_bio_shutdown() if there is a
fatal error.

6 hours agovirtual_server_cf_parse returns a virtual_server_t not a CONF_SECTION
Nick Porter [Thu, 7 Aug 2025 11:25:43 +0000 (12:25 +0100)] 
virtual_server_cf_parse returns a virtual_server_t not a CONF_SECTION

6 hours agoUse the thread source port range, rather than the instance
Nick Porter [Wed, 6 Aug 2025 14:54:01 +0000 (15:54 +0100)] 
Use the thread source port range, rather than the instance

6 hours agoSplit the restricted source port range per thread
Nick Porter [Wed, 6 Aug 2025 14:53:13 +0000 (15:53 +0100)] 
Split the restricted source port range per thread

6 hours agoWe do use SO_REUSEPORT for some clients
Nick Porter [Wed, 6 Aug 2025 12:58:27 +0000 (13:58 +0100)] 
We do use SO_REUSEPORT for some clients

6 hours agoOnly unlink bio if it is in a chain
Nick Porter [Thu, 7 Aug 2025 10:45:17 +0000 (11:45 +0100)] 
Only unlink bio if it is in a chain

6 hours agoCorrect bio chain re-link
Nick Porter [Thu, 7 Aug 2025 11:31:20 +0000 (12:31 +0100)] 
Correct bio chain re-link

7 hours agoptrs may be NULL
Alan T. DeKok [Thu, 7 Aug 2025 11:03:04 +0000 (07:03 -0400)] 
ptrs may be NULL

7 hours agoat least one ptr has to be set
Alan T. DeKok [Thu, 7 Aug 2025 10:26:13 +0000 (06:26 -0400)] 
at least one ptr has to be set

17 hours agoset flags before allocating parent
Alan T. DeKok [Thu, 7 Aug 2025 01:20:48 +0000 (21:20 -0400)] 
set flags before allocating parent

and unknown attributes can allocate EXT_VENDOR

which helps with unknown VSAs.  They previously result in a
Vendor-Specific { Foo { } } being allocated, and then an error
returned of "dict is read only".

At that point, the decoder would then create a raw top-level
attribute

24 hours agorevisit and clean up destructor vs shutdown
Alan T. DeKok [Wed, 6 Aug 2025 15:43:43 +0000 (11:43 -0400)] 
revisit and clean up destructor vs shutdown

shutdown can be called on fatal error, and only stops the BIO.
the underlying BIO is still there.  This allows it to be called
from a BIO which is in the middle of a chain.

destructor calls shutdown first, and then frees the resources.
this allows a destructor to be called from anywhere, and then the
entire chain is shut down

24 hours agoclean up shutdown and destructor
Alan T. DeKok [Wed, 6 Aug 2025 14:59:08 +0000 (10:59 -0400)] 
clean up shutdown and destructor

some shutdowns can fail, so the function needs to return an rcode.

the destructors should just call the shutdown, so the caller can
just talloc_free() things, and have it all work properly.

the shutdown doesn't need to reset the destructors, as the main
fr_bio_shutdown() will do that.

24 hours agoupdate sbuff macros to catch more corner cases
Alan T. DeKok [Wed, 6 Aug 2025 12:22:27 +0000 (08:22 -0400)] 
update sbuff macros to catch more corner cases

FR_SBUFF_IN() is for reading from the sbuff.
FR_SBUFF_OUT() is for writing to the sbuff.

Using the same description for both is very confusing.  Allowing
a writeable sbuff to take 'char const*' input is bad.

24 hours agohoist common checks to macro
Alan T. DeKok [Wed, 6 Aug 2025 12:22:08 +0000 (08:22 -0400)] 
hoist common checks to macro

26 hours agouse the correct sbuff macro.
Alan T. DeKok [Wed, 6 Aug 2025 11:48:23 +0000 (07:48 -0400)] 
use the correct sbuff macro.

OUT is for printing, IN is for parsing pre-existing data.

30 hours agouse the correct sbuff macro.
Alan T. DeKok [Wed, 6 Aug 2025 11:48:23 +0000 (07:48 -0400)] 
use the correct sbuff macro.

33 hours agoEnsure fr_bio_fd_open returns an error when there is one
Nick Porter [Wed, 6 Aug 2025 08:53:51 +0000 (09:53 +0100)] 
Ensure fr_bio_fd_open returns an error when there is one

2 days agoWS
Arran Cudbard-Bell [Tue, 5 Aug 2025 18:01:17 +0000 (12:01 -0600)] 
WS

2 days agoAdd another Calix VSA we observed in the wild
Arran Cudbard-Bell [Tue, 5 Aug 2025 18:00:55 +0000 (12:00 -0600)] 
Add another Calix VSA we observed in the wild

2 days agoUse better method for un-marshalling Perl values to pairs
Nick Porter [Tue, 5 Aug 2025 14:30:53 +0000 (15:30 +0100)] 
Use better method for un-marshalling Perl values to pairs

2 days agoNo need to talloc a temporary box
Nick Porter [Tue, 5 Aug 2025 13:54:33 +0000 (14:54 +0100)] 
No need to talloc a temporary box

2 days agoCast ruby string length to a consistent type
Nick Porter [Tue, 5 Aug 2025 12:36:31 +0000 (13:36 +0100)] 
Cast ruby string length to a consistent type

2 days agoAdd test using float value in mRuby
Nick Porter [Tue, 5 Aug 2025 11:30:19 +0000 (12:30 +0100)] 
Add test using float value in mRuby

2 days agoBetter method of un-marshalling values from mRuby to FreeRADIUS
Nick Porter [Tue, 5 Aug 2025 11:29:39 +0000 (12:29 +0100)] 
Better method of un-marshalling values from mRuby to FreeRADIUS

2 days agofirst attempt at limiting the source port for %radius.sendto.ipaddr()
Alan T. DeKok [Mon, 4 Aug 2025 21:52:37 +0000 (17:52 -0400)] 
first attempt at limiting the source port for %radius.sendto.ipaddr()

the code is commented out for now, as it is a change of behavior

2 days agofix typo
Alan T. DeKok [Mon, 4 Aug 2025 20:57:10 +0000 (16:57 -0400)] 
fix typo

2 days agoadd documentation for states
Alan T. DeKok [Mon, 4 Aug 2025 20:57:00 +0000 (16:57 -0400)] 
add documentation for states

2 days agoadd function to create total order of attributes
Alan T. DeKok [Mon, 4 Aug 2025 14:44:49 +0000 (10:44 -0400)] 
add function to create total order of attributes

2 days agoUNUSED
Nick Porter [Mon, 4 Aug 2025 18:29:53 +0000 (19:29 +0100)] 
UNUSED

2 days agoFreeBSD has accept4()
Nick Porter [Mon, 4 Aug 2025 18:24:45 +0000 (19:24 +0100)] 
FreeBSD has accept4()

3 days agoEnsure we depend on non-broken libkqueue
Nick Porter [Mon, 4 Aug 2025 17:20:37 +0000 (18:20 +0100)] 
Ensure we depend on non-broken libkqueue

Some .deb platforms package libkqueue 2.3.1

3 days agoSimplify .deb ssl dependency logic
Nick Porter [Mon, 4 Aug 2025 16:38:32 +0000 (17:38 +0100)] 
Simplify .deb ssl dependency logic

since we require OpenSSL >= 3.0

3 days agoadd attribute type 'attr' and test VALUE
Alan T. DeKok [Mon, 4 Aug 2025 13:07:12 +0000 (09:07 -0400)] 
add attribute type 'attr' and test VALUE

not used for anything yet, because the encoder / decoder do not
support it

3 days agoallow '@' references for value box parser
Alan T. DeKok [Mon, 4 Aug 2025 12:49:34 +0000 (08:49 -0400)] 
allow '@' references for value box parser

the reference can't change dictionaries

3 days agoadd da root to value-box parser for VALUE
Alan T. DeKok [Mon, 4 Aug 2025 12:49:06 +0000 (08:49 -0400)] 
add da root to value-box parser for VALUE

3 days agoadd character set for allowed names of nested attrs
Alan T. DeKok [Mon, 4 Aug 2025 12:48:36 +0000 (08:48 -0400)] 
add character set for allowed names of nested attrs

which is the allowed list for attrs, plus '.'

3 days agofix error message
Alan T. DeKok [Mon, 4 Aug 2025 12:27:57 +0000 (08:27 -0400)] 
fix error message

4 days agoexport dict_protocol_reference, and make it take an sbuff
Alan T. DeKok [Sun, 3 Aug 2025 15:36:15 +0000 (11:36 -0400)] 
export dict_protocol_reference, and make it take an sbuff

in preparation for other work with @foo in value-boxes

4 days agouse FR_SBUFF_IN_STR() for common cases
Alan T. DeKok [Sun, 3 Aug 2025 15:18:01 +0000 (11:18 -0400)] 
use FR_SBUFF_IN_STR() for common cases

4 days agodefine FR_SBUFF_IN_STR() as a shorthand for IN(foo, strlen(foo))
Alan T. DeKok [Sun, 3 Aug 2025 15:12:30 +0000 (11:12 -0400)] 
define FR_SBUFF_IN_STR() as a shorthand for IN(foo, strlen(foo))

4 days agodisallow ::43 as enum names
Alan T. DeKok [Sun, 3 Aug 2025 14:56:33 +0000 (10:56 -0400)] 
disallow ::43 as enum names

5 days agodon't allow copying of cursors
Alan T. DeKok [Sat, 2 Aug 2025 10:56:41 +0000 (06:56 -0400)] 
don't allow copying of cursors

5 days agoprint the input expansion before running the function
Alan T. DeKok [Sat, 2 Aug 2025 10:53:19 +0000 (06:53 -0400)] 
print the input expansion before running the function

not afterwards.  this makes it much easier to read the debug output

5 days agoremove ACCEPTED state.
Alan T. DeKok [Sat, 2 Aug 2025 10:48:31 +0000 (06:48 -0400)] 
remove ACCEPTED state.

and more cleanups for accept. We can't re-open an accepted socket

5 days agore-add "char const *end" as allowed
Alan T. DeKok [Fri, 1 Aug 2025 18:45:24 +0000 (14:45 -0400)] 
re-add "char const *end" as allowed

5 days agoadd notes about attribute comparisons
Alan T. DeKok [Fri, 1 Aug 2025 18:36:40 +0000 (14:36 -0400)] 
add notes about attribute comparisons

6 days agohoist initialize output to macro
Alan T. DeKok [Fri, 1 Aug 2025 12:04:05 +0000 (08:04 -0400)] 
hoist initialize output to macro

so we don't have 'ifdef STATIC_ANALYZER' everywhere.  And hopefully
then since the initialization is unconditional, the analyzer will
actually figure out that the output is initialized.

6 days agoremove more "default:", and add more "case FR_TYPE_ATTR:"
Alan T. DeKok [Thu, 31 Jul 2025 17:24:29 +0000 (13:24 -0400)] 
remove more "default:", and add more "case FR_TYPE_ATTR:"

6 days agouse dictionary function to compare two attributes
Alan T. DeKok [Thu, 31 Jul 2025 17:22:02 +0000 (13:22 -0400)] 
use dictionary function to compare two attributes

comparing by only the leaf attr was arguably wrong, as it ignored
any depth or parenting.

we use an fr_dict function to do the comparison.  But that just
compares the pointers, and isn't stable.  Arguably that should
be fixed, too.

The fix depends on whether we want to just sort different attributes,
or whether we want to order them.  If we're just sorting them, then
the current code is OK.

6 days agoadd more size, and assert that max is initialized
Alan T. DeKok [Thu, 31 Jul 2025 17:21:39 +0000 (13:21 -0400)] 
add more size, and assert that max is initialized

6 days agounify unsupported cast code
Alan T. DeKok [Thu, 31 Jul 2025 16:28:43 +0000 (12:28 -0400)] 
unify unsupported cast code

6 days agomove generic to 1, so that returning -1 is better
Alan T. DeKok [Wed, 30 Jul 2025 21:21:52 +0000 (17:21 -0400)] 
move generic to 1, so that returning -1 is better

6 days agodon't allow fr_bio_fd_open() to be passed accepted sockets
Alan T. DeKok [Wed, 30 Jul 2025 11:55:43 +0000 (07:55 -0400)] 
don't allow fr_bio_fd_open() to be passed accepted sockets

we will fix fr_bio_fd_accept() in another commit.

6 days agoremove errant debug call developer/arr2036
Arran Cudbard-Bell [Thu, 31 Jul 2025 22:18:55 +0000 (15:18 -0700)] 
remove errant debug call

6 days agoAdopt a standard naming convention and signture for debug functions
James Jones [Fri, 31 Jan 2025 19:56:05 +0000 (13:56 -0600)] 
Adopt a standard naming convention and signture for debug functions

To get the "dd" debugger command to work without having to create an
wxplicit mapping from type to function either by hand or by runtime
inspection (the latter preventing setting up the command at debugger
startup), the debug functions that dd calls should have a type of
the form

    foo_debug(FILE *fp, foo_t const *)

We add the qualifier becausen
 * some support functions with extra parameters are meant to be
   called by these functions, which pass the additional parameters;
   the functions we do call can pass fp along, or in the case of
   src/lib/util/dict_print.c, add fp to the context
 * fe_dict_attr_t * has three debug functions
 * fr_pair_validate_debug() takes a pointer to an array, and
   thus can't follow the convention
 * virtual_server_{listen, process}_debug() and module_rlm_list_debug()
   have *no* parameters

6 days agoRevert "might as well save the result somewhere"
Arran Cudbard-Bell [Thu, 31 Jul 2025 06:48:52 +0000 (23:48 -0700)] 
Revert "might as well save the result somewhere"

This reverts commit 67362500acb9860f0175900236c182b4ae78d420.

6 days agoFix shallow copy for FR_TYPE_ATTR
Arran Cudbard-Bell [Thu, 31 Jul 2025 06:48:15 +0000 (23:48 -0700)] 
Fix shallow copy for FR_TYPE_ATTR

6 days agoFix includes
Arran Cudbard-Bell [Thu, 31 Jul 2025 06:48:04 +0000 (23:48 -0700)] 
Fix includes

6 days agoAlways check the return value from fr_value_box_copy
Arran Cudbard-Bell [Thu, 31 Jul 2025 06:47:40 +0000 (23:47 -0700)] 
Always check the return value from fr_value_box_copy

7 days agoAdd RADIUS Id and Authenticator to request pair list
Nick Porter [Thu, 31 Jul 2025 17:25:37 +0000 (18:25 +0100)] 
Add RADIUS Id and Authenticator to request pair list

7 days agoAdd json.encode regression test for DHCPv4 in RADIUS
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:45:04 +0000 (21:45 -0700)] 
Add json.encode regression test for DHCPv4 in RADIUS

7 days agoThe enumv isn't an ancestor of the attribute being printed
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:44:47 +0000 (21:44 -0700)] 
The enumv isn't an ancestor of the attribute being printed

7 days agoWhen storing an enum for later parsing, we need to store the '::' prefix too
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:23:12 +0000 (21:23 -0700)] 
When storing an enum for later parsing, we need to store the '::' prefix too

7 days agoFix copying FR_TYPE_ATTR
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:22:36 +0000 (21:22 -0700)] 
Fix copying FR_TYPE_ATTR

7 days agoEncoded attributes can be infinitely long, and definitely more than 4 bytes
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:22:23 +0000 (21:22 -0700)] 
Encoded attributes can be infinitely long, and definitely more than 4 bytes

7 days agoNo reason to add 'da' as part of the cursor struct
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:21:47 +0000 (21:21 -0700)] 
No reason to add 'da' as part of the cursor struct

7 days agoCheck for vp_attr in PAIR_VERIFY
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:21:17 +0000 (21:21 -0700)] 
Check for vp_attr in PAIR_VERIFY

7 days agoCan't use verify here, as we're appending half constructed pairs
Arran Cudbard-Bell [Thu, 31 Jul 2025 04:21:03 +0000 (21:21 -0700)] 
Can't use verify here, as we're appending half constructed pairs

7 days agoattr: These conversions are all fine
Arran Cudbard-Bell [Thu, 31 Jul 2025 01:55:05 +0000 (18:55 -0700)] 
attr: These conversions are all fine

7 days agoAdd simplified redundant test
Arran Cudbard-Bell [Wed, 30 Jul 2025 19:51:56 +0000 (12:51 -0700)] 
Add simplified redundant test

7 days agoDon't spit out errors for blastradius
Arran Cudbard-Bell [Wed, 30 Jul 2025 19:51:43 +0000 (12:51 -0700)] 
Don't spit out errors for blastradius

8 days agoAdd test of %rest() receiving a failure HTTP status code
Nick Porter [Wed, 30 Jul 2025 13:15:16 +0000 (14:15 +0100)] 
Add test of %rest() receiving a failure HTTP status code

8 days agoWhen %rest() get a failure HTTP status code capture the body in REST-HTTP-Body
Nick Porter [Wed, 30 Jul 2025 13:03:28 +0000 (14:03 +0100)] 
When %rest() get a failure HTTP status code capture the body in REST-HTTP-Body

Recent correction to rcode handling have resulted in xlats which return
XLAT_ACTION_FAIL having their output disgarded, so the previous
behaviour of %rest() was lost.

This approach gives more consistent behaviour with other xlats, but
still allows access to any errors reported by the server in the reply
body.

9 days agomove DHCPv6 to use FR_TYPE_ATTR
Alan T. DeKok [Tue, 29 Jul 2025 17:11:00 +0000 (13:11 -0400)] 
move DHCPv6 to use FR_TYPE_ATTR

9 days agoparse OIDs numerically if we don't know the name
Alan T. DeKok [Tue, 29 Jul 2025 17:10:32 +0000 (13:10 -0400)] 
parse OIDs numerically if we don't know the name

9 days agodocs-v4: update top-level and sub-section landing pages HIVE 4114/8. Added xrefs...
nolade [Tue, 15 Jul 2025 19:21:52 +0000 (15:21 -0400)] 
docs-v4: update top-level and sub-section landing pages HIVE 4114/8. Added xrefs, rewrote some intros.

9 days agodocs-v4: Update Introduction landing page and nav panel HIVE 4114/5
nolade [Thu, 10 Jul 2025 16:35:44 +0000 (12:35 -0400)] 
docs-v4: Update Introduction landing page and nav panel HIVE 4114/5

9 days agoadded some more guidance
Alan T. DeKok [Tue, 29 Jul 2025 13:42:03 +0000 (09:42 -0400)] 
added some more guidance

9 days agodocs-v4: Fix make docsite errors
nolade [Wed, 16 Jul 2025 20:36:31 +0000 (16:36 -0400)] 
docs-v4: Fix make docsite errors

9 days agoswitch dhcpv4 to use FR_TYPE_ATTR for Parameter-Request-List
Alan T. DeKok [Tue, 29 Jul 2025 13:04:30 +0000 (09:04 -0400)] 
switch dhcpv4 to use FR_TYPE_ATTR for Parameter-Request-List

the underlying data type / length of the encoding is defined by
the size of the attribute number, and not by the dictionaries

9 days agoallow FR_TYPE_ATTR to be passed in as enumv for decoding
Alan T. DeKok [Tue, 29 Jul 2025 13:04:10 +0000 (09:04 -0400)] 
allow FR_TYPE_ATTR to be passed in as enumv for decoding

9 days agodecode FR_TYPE_ATTR
Alan T. DeKok [Tue, 29 Jul 2025 11:53:40 +0000 (07:53 -0400)] 
decode FR_TYPE_ATTR

9 days agoprint full received data on -xx
Alan T. DeKok [Tue, 29 Jul 2025 11:53:19 +0000 (07:53 -0400)] 
print full received data on -xx

9 days agoverify FR_TYPE_ATTR
Alan T. DeKok [Tue, 29 Jul 2025 10:42:57 +0000 (06:42 -0400)] 
verify FR_TYPE_ATTR

9 days agodon't assert if we fail to instantiate the dictionaries
Alan T. DeKok [Tue, 29 Jul 2025 10:36:27 +0000 (06:36 -0400)] 
don't assert if we fail to instantiate the dictionaries

9 days agocleanups and tests
Alan T. DeKok [Tue, 29 Jul 2025 09:38:54 +0000 (05:38 -0400)] 
cleanups and tests

we might as well use "::" for FR_TYPE_ATTR, too.  This makes them
look and feel like enums, rather than adding extra-special syntax

9 days agobe safe when passed a dict root
Alan T. DeKok [Tue, 29 Jul 2025 09:54:42 +0000 (05:54 -0400)] 
be safe when passed a dict root

9 days agoAdd map tests with nested LHS
Nick Porter [Tue, 29 Jul 2025 09:56:51 +0000 (10:56 +0100)] 
Add map tests with nested LHS

9 days agomap_to_request expects the value callback to only create the leaf pair
Nick Porter [Tue, 29 Jul 2025 09:43:05 +0000 (10:43 +0100)] 
map_to_request expects the value callback to only create the leaf pair

It does the job of creating any interim structural pairs required

9 days agodon't call shutdown recursively
Alan T. DeKok [Tue, 29 Jul 2025 09:00:23 +0000 (05:00 -0400)] 
don't call shutdown recursively

9 days agoPacify coverity (CID #1660567)
Nick Porter [Tue, 29 Jul 2025 08:14:18 +0000 (09:14 +0100)] 
Pacify coverity (CID #1660567)

9 days agoRemove libpcre references from docs
Nick Porter [Mon, 28 Jul 2025 16:17:28 +0000 (17:17 +0100)] 
Remove libpcre references from docs

9 days agoRemove feature.regex-pcre from tests
Nick Porter [Mon, 28 Jul 2025 16:14:39 +0000 (17:14 +0100)] 
Remove feature.regex-pcre from tests