]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
initialize list for dynamic clients
authorAlan T. DeKok <aland@freeradius.org>
Wed, 24 Jan 2018 16:59:48 +0000 (11:59 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 24 Jan 2018 16:59:48 +0000 (11:59 -0500)
src/modules/proto_radius/notes.md
src/modules/proto_radius/proto_radius_udp.c

index 2c604f88f00b0e6f7e67e0a4e51f6e45ff1aed5f..810a4c1a9234936baef76cd7c0dd9b47c3bae8f9 100644 (file)
@@ -131,6 +131,27 @@ connection" code, and proceed as before.
 
 ## proto_radius_connected_udp
 
+Pretty much implemented as documented below.
+
+### NAT
+
+NAT mostly works.  The main limitation left is that the client list is
+by source IP, and NOT by src/dst ip/port.  So we probably need a
+*separate* rbtree for NATed clients.
+
+i.e. `src/main/client.c`, struct `radclient_list` has to have a `rbtree_t *nat`
+
+Which is used ONLY if `client->behind_nat == true`.
+
+and the rbtree callback function compares src/dst ip/port.
+
+Since all of the calls are abstracted behind `client_add()`, etc.  We
+can just update `client.c`, and have it all automagically work.
+
+The one caveat is we don't
+
+### how it works
+
 uses the `proto_radius_udp_t` for simplicity
 
 Which has added:
index fb6737447ca41c958c830fdd3dd5a96975e650d5..64564fce6ab4e844867a2d9602fff5abc66b0674 100644 (file)
@@ -1334,6 +1334,8 @@ static ssize_t mod_write(void *instance, void *packet_ctx,
 
                rad_assert(buffer_len == sizeof(newclient));
                memcpy(&newclient, buffer, sizeof(newclient));
+               FR_DLIST_INIT(newclient->pending);
+               FR_DLIST_INIT(newclient->packets);
 
                /*
                 *      This client is ONLY for a particular