]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make provisions for non-radius packet tracking
authorAlan T. DeKok <aland@freeradius.org>
Mon, 1 Apr 2019 15:34:32 +0000 (11:34 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 1 Apr 2019 15:34:32 +0000 (11:34 -0400)
src/lib/io/app_io.h
src/lib/io/master.c

index dd07268fd4f9ec636143c8fd62d761df62a757ed..bc6d0a6ebcfdb99bc495bae4076b771f08dc4f2a 100644 (file)
@@ -63,6 +63,12 @@ typedef struct {
 
        fr_io_nak_t                     nak;            //!< Function to send a NAK.
 
+       /*
+        *      @todo - this should compare two sets of track
+        *      information, not packets.  We also want a function
+        *      that converts a packet to a tracking structure.
+        *      Either in a buffer, or in a newly-allocated memory.
+        */
        fr_io_data_cmp_t                compare;        //!< compare two packets
 
        fr_io_connection_set_t          connection_set; //!< set src/dst IP/port of a connection
index 815761c0b91ff9fd67b5b1819718c93624f157fc..9d6150ec290639ba02ecb7de005a5e81b199cdba 100644 (file)
@@ -790,6 +790,11 @@ static fr_io_track_t *fr_io_track_add(fr_io_client_t *client,
 
        my_track.address = address;
        my_track.client = client;
+
+       /*
+        *      @todo - convert the packet to a tracking structure,
+        *      and look that up instead of the packet.
+        */
        memcpy(my_track.packet, packet, sizeof(my_track.packet));
 
        if (client->inst->app_io->track_duplicates) track = rbtree_finddata(client->table, &my_track);
@@ -806,6 +811,9 @@ static fr_io_track_t *fr_io_track_add(fr_io_client_t *client,
                        track->address = client->connection->address;
                }
 
+               /*
+                *      @todo - copy my_track structure, not the packet.
+                */
                memcpy(track->packet, packet, sizeof(track->packet));
                track->timestamp = recv_time;
                track->packets = 1;
@@ -816,6 +824,8 @@ static fr_io_track_t *fr_io_track_add(fr_io_client_t *client,
 
        /*
         *      Is it exactly the same packet?
+        *
+        *      @todo - compare the tracking structure, not the packet
         */
        if (memcmp(track->packet, my_track.packet, sizeof(my_track.packet)) == 0) {
                /*
@@ -835,6 +845,8 @@ static fr_io_track_t *fr_io_track_add(fr_io_client_t *client,
 
        /*
         *      The new packet is different from the old one.
+        *
+        *      @todo - copy my_track structure, not the packet.
         */
        memcpy(track->packet, my_track.packet, sizeof(my_track.packet));
        track->timestamp = recv_time;