]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove erroneous NAT code
authorAlan T. DeKok <aland@freeradius.org>
Thu, 15 Feb 2018 18:01:03 +0000 (13:01 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 15 Feb 2018 18:01:03 +0000 (13:01 -0500)
this should now be handled automatically by mod_read()

src/modules/proto_radius/proto_radius_udp.c

index 0d5d8eca0708f0dec44322d148b9260af2b2ee4e..e47482fee91f0714487d9a423c6b4867f5ea83b2 100644 (file)
@@ -1443,73 +1443,6 @@ static ssize_t mod_write(void *instance, void *packet_ctx,
                FR_DLIST_INIT(newclient->pending);
                FR_DLIST_INIT(newclient->packets);
 
-               /*
-                *      This client is ONLY for a particular
-                *      connection.  We have to find all matching
-                *      packets by src/dst IP/port, and send them to
-                *      the new connection.
-                */
-               if (newclient->behind_nat) {
-                       client->is_nat = true;
-
-                       while ((entry = FR_DLIST_FIRST(client->packets)) != NULL) {
-                               proto_radius_udp_address_t *newaddress;
-
-                               saved = fr_ptr_to_type(dynamic_packet_t, entry, entry);
-                               (void) talloc_get_type_abort(saved, dynamic_packet_t);
-
-                               fr_dlist_remove(&saved->entry);
-                               fr_dlist_insert_tail(&inst->dynamic_clients.packets, &saved->entry);
-
-                               newaddress = (proto_radius_udp_address_t *) &saved->track->src_dst[0];
-                               if ((newaddress->src_port == address->src_port) &&
-                                   (newaddress->dst_port == address->dst_port) &&
-                                   (fr_ipaddr_cmp(&newaddress->src_ipaddr, &address->src_ipaddr) == 0) &&
-                                   (fr_ipaddr_cmp(&newaddress->dst_ipaddr, &address->dst_ipaddr) == 0)) {
-                                       newaddress->client->received--;
-                                       newaddress->client = newclient;
-                                       newaddress->client->received++;
-                               }
-
-                               rad_assert(inst->dynamic_clients.num_pending_packets > 0);
-                               inst->dynamic_clients.num_pending_packets--;
-                       }
-
-                       /*
-                        *      There are still saved packets from this source IP.
-                        *
-                        *      @todo - figure out what to do here.
-                        */
-                       if ((entry = FR_DLIST_FIRST(client->packets)) != NULL) {
-                               rad_assert(0 == 1);
-                               fr_exit_now(EXIT_FAILURE);
-                       }
-
-                       /*
-                        *      No packets are outstanding for this
-                        *      dynamic client.  Delete it.
-                        */
-                       client_delete(inst->dynamic_clients.clients, client);
-                       fr_dlist_remove(&client->pending);
-                       talloc_free(client);
-
-                       /*
-                        *      Note that we do NOT add it to any
-                        *      list.  Instead, mod_read() will clean
-                        *      it up.
-                        */
-                       newclient->dynamic = true;
-                       newclient->active = true;
-
-                       /*
-                        *      Do NOT delete the tracking table
-                        *      entry.  The packet has to be
-                        *      re-injected!.
-                        */
-                       fr_network_listen_read(inst->nr, inst->parent->listen);
-                       return buffer_len;
-               }
-
                /*
                 *      Delete the "pending" client from the client list.
                 */