username / password, for Access-Request, and just username for
Accounting-Request.
-## Replication (i.e. not proxying)
-
-allow for "no reply" proxying, where we don't care about getting the reply
-i.e. we still drain the socket, we just don't do anything with the replies
-
{ FR_CONF_OFFSET("transport", FR_TYPE_VOID, rlm_radius_t, io_submodule),
.func = transport_parse },
+ { FR_CONF_OFFSET("replicate", FR_TYPE_BOOL, rlm_radius_t, replicate) },
+
{ FR_CONF_OFFSET("type", FR_TYPE_UINT32 | FR_TYPE_MULTI | FR_TYPE_NOT_EMPTY | FR_TYPE_REQUIRED, rlm_radius_t, types),
.func = type_parse },
struct timeval reconnection_delay;
struct timeval idle_timeout;
+ bool replicate; //!< are we ignoring responses?
+
dl_instance_t *io_submodule; //!< As provided by the transport_parse
fr_radius_client_io_t const *io; //!< Easy access to the IO handle
void *io_instance; //!< Easy access to the IO instance
bool recv_buff_is_set; //!< Whether we were provided with a recv_buf
bool send_buff_is_set; //!< Whether we were provided with a send_buf
+ bool replicate; //!< copied from parent->replicate
} rlm_radius_udp_t;
ssize_t data_len;
uint8_t original[20];
+ /*
+ * @todo - call read() until it returns no data. There
+ * may be multiple packets pending! We don't want to go
+ * through a whole kevent cycle just to read another packet.
+ */
data_len = read(fd, c->buffer, c->buflen);
if (data_len == 0) return;
return;
}
+ /*
+ * Replicating? Drain the socket, but ignore all responses.
+ */
+ if (c->inst->replicate) return;
+
packet_len = data_len;
if (!fr_radius_ok(c->buffer, &packet_len, false, &reason)) {
DEBUG("Ignoring malformed packet");
return;
}
+ /*
+ * We're replicating, so we don't care about the
+ * responses. Don't do any retransmission
+ * timers, etc.
+ */
+ if (c->inst->replicate) {
+ mod_finished_request(c, u);
+ continue;
+ }
+
/*
* Start the retransmission timers.
*/
rlm_radius_udp_t *inst = talloc_get_type_abort(instance, rlm_radius_udp_t);
inst->parent = parent;
+ inst->replicate = parent->replicate;
/*
* Ensure that we have a destination address.