]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
pass packet_ct to NAK routine
authorAlan T. DeKok <aland@freeradius.org>
Thu, 12 Apr 2018 14:10:40 +0000 (10:10 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 16 Apr 2018 18:41:31 +0000 (14:41 -0400)
src/lib/io/io.h
src/lib/io/worker.c
src/tests/util/radius1_test.c
src/tests/util/radius_schedule_test.c
src/tests/util/worker_test.c

index 63798ad69b1785ca4446b7d0df8cfd644fb878d3..2e48f506e916945a6c5cd5e57d552d1a1be43433 100644 (file)
@@ -142,13 +142,14 @@ typedef ssize_t (*fr_io_encode_t)(void const *instance, REQUEST *request, uint8_
  *  "do not respond", even if duplicates come in.
  *
  * @param[in] instance         the context for this function.
+ * @param[out] packet_ctx      the  packet_ctx struct containing request specific data.
  * @param[in] packet           the packet to NAK
  * @param[in] packet_len       length of the packet to NAK
  * @param[in] reply            the NAK reply
  * @param[in] reply_len                length of the buffer where the reply should be placed.
  * @return length of the data in the reply buffer.
  */
-typedef size_t (*fr_io_nak_t)(void const *instance, uint8_t *const packet, size_t packet_len,
+typedef size_t (*fr_io_nak_t)(void const *instance, void *packet_ctx, uint8_t *const packet, size_t packet_len,
                              uint8_t *reply, size_t reply_len);
 
 /** Read from a socket.
index d709663be0d78aa727a75c49ee544a40fd48efff..a4f7c953ccacca6053e8e220a9c263e934626681 100644 (file)
@@ -395,7 +395,7 @@ static void fr_worker_nak(fr_worker_t *worker, fr_channel_data_t *cd, fr_time_t
         *      Encode a NAK
         */
        if (listen->app_io->nak) {
-               size = listen->app_io->nak(listen->app_io_instance, cd->m.data,
+               size = listen->app_io->nak(listen->app_io_instance, cd->packet_ctx, cd->m.data,
                                           cd->m.data_size, reply->m.data, reply->m.rb_size);
        } else {
                size = 1;       /* rely on them to figure it the heck out */
index 63b14e7f96e2efb119decf89a8696cd0862414be..2576c917cafbe878e580bb8033cb8999193a188d 100644 (file)
@@ -135,7 +135,7 @@ static ssize_t test_encode(UNUSED void const *instance, REQUEST *request, uint8_
        return 20;
 }
 
-static size_t test_nak(void const *instance, uint8_t *const packet, size_t packet_len, UNUSED uint8_t *reply, UNUSED size_t reply_len)
+static size_t test_nak(void const *instance, UNUSED void *packet_ctx, uint8_t *const packet, size_t packet_len, UNUSED uint8_t *reply, UNUSED size_t reply_len)
 {
        MPRINT1("\t\tNAK !!! request %d - data %p %p size %zd\n", packet[1], instance, packet, packet_len);
 
index 0ad378293a34d0d537ede5ff01bd85c0ff47d44d..0fb665082846457dc360b4e189566976ea2ffcca 100644 (file)
@@ -105,7 +105,7 @@ static ssize_t test_encode(void const *instance, REQUEST *request, uint8_t *buff
        return 20;
 }
 
-static size_t test_nak(void const *ctx, uint8_t *const packet, size_t packet_len, UNUSED uint8_t *reply, UNUSED size_t reply_len)
+static size_t test_nak(void const *ctx, UNUSED void *packet_ctx, uint8_t *const packet, size_t packet_len, UNUSED uint8_t *reply, UNUSED size_t reply_len)
 {
        MPRINT1("\t\tNAK !!! request %d - data %p %p size %zd\n", packet[1], ctx, packet, packet_len);
 
index 3989f41b372522958c3db5dcec030188474892da..f0b58e3754bf7950ad3a845e5dd03ff74b0a9d69 100644 (file)
@@ -130,7 +130,7 @@ static ssize_t test_encode(void const *instance, REQUEST *request, uint8_t *cons
        return data_len;
 }
 
-static size_t test_nak(void const *packet_ctx, uint8_t *const packet, size_t packet_len, uint8_t *reply, UNUSED size_t reply_len)
+static size_t test_nak(UNUSED void const *instance, UNUSED void *packet_ctx, uint8_t *const packet, size_t packet_len, uint8_t *reply, UNUSED size_t reply_len)
 {
        uint32_t number;