#
# no_connection_fail = no
+ #
+ # originate::
+ #
+ # Sometimes we are creating a request that is not for the purpose of
+ # proxying another request, in which case we do not want to add a
+ # Proxy-State attribute.
+ #
+ # In some cases, such as originating a CoA or Disconnect request,
+ # including Proxy-State may confuse the receiving NAS.
+# originate = no
+
#
# status_checks { ... }:: For "are you alive?" queries.
#
{ FR_CONF_OFFSET("no_connection_fail", FR_TYPE_BOOL, rlm_radius_t, no_connection_fail) },
+ { FR_CONF_OFFSET("originate", FR_TYPE_BOOL, rlm_radius_t, originate) },
+
{ FR_CONF_POINTER("status_checks", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) status_checks_config },
{ FR_CONF_OFFSET("max_connections", FR_TYPE_UINT32, rlm_radius_t, max_connections), .dflt = STRINGIFY(32) },
bool replicate; //!< are we ignoring responses?
bool synchronous; //!< are we doing synchronous proxying?
bool no_connection_fail; //!< are we failing immediately on no connection?
+ bool originate; //!< are we originating packets rather than proxying?
dl_module_inst_t *io_submodule; //!< As provided by the transport_parse
fr_radius_client_io_t const *io; //!< Easy access to the IO handle
}
/*
- * Add Proxy-State to the tail end of the packet.
+ * Add Proxy-State to the tail end of the packet unless we are
+ * originating the request.
+ *
* We need to add it here, and NOT in
* request->packet->vps, because multiple modules
* may be sending the packets at the same time.
* Note that the length check will always pass, due to
* the buflen manipulation done above.
*/
- if (proxy_state) {
+ if (proxy_state && !c->inst->parent->originate) {
uint8_t *attr = c->buffer + packet_len;
VALUE_PAIR *vp;
vp_cursor_t cursor;
* checks.
*/
if (u != radius->status_u) {
- if (!c->inst->parent->synchronous) {
- RDEBUG("Proxying request. Expecting response within %d.%06ds",
- u->timer.rt / USEC, u->timer.rt % USEC);
+ const char* action;
+ action = c->inst->parent->originate ? "Originating" : "Proxying";
+ if (!c->inst->parent->synchronous) {
+ RDEBUG("%s request. Expecting response within %d.%06ds",
+ action, u->timer.rt / USEC, u->timer.rt % USEC);
} else {
/*
* If the packet doesn't get a response,
* request through a fail handler,
* instead of just freeing it.
*/
- RDEBUG("Proxying request. Relying on NAS to perform retransmissions");
+ RDEBUG("%s request. Relying on NAS to perform retransmissions", action);
}
/*