fr_assert(buffer_len >= sizeof(client));
+ /*
+ * We don't accept the new client, so don't do
+ * anything.
+ */
+ if (request->reply->code != FR_DHCP_ACK) {
+ *buffer = true;
+ return 1;
+ }
+
/*
* Allocate the client. If that fails, send back a NAK.
*
fr_assert(buffer_len >= sizeof(client));
+ /*
+ * We don't accept the new client, so don't do
+ * anything.
+ */
+ if (request->reply->code != FR_DHCPV6_REPLY) {
+ *buffer = true;
+ return 1;
+ }
+
/*
* Allocate the client. If that fails, send back a NAK.
*
CONF_SECTION *lease_unknown;
CONF_SECTION *lease_active;
CONF_SECTION *do_not_respond;
+
+ CONF_SECTION *new_client;
+ CONF_SECTION *add_client;
+ CONF_SECTION *deny_client;
} process_dhcpv4_sections_t;
typedef struct {
#define PROCESS_CODE_DO_NOT_RESPOND FR_DHCP_DO_NOT_RESPOND
#define PROCESS_PACKET_CODE_VALID FR_DHCP_PROCESS_CODE_VALID
#define PROCESS_INST process_dhcpv4_t
+#define PROCESS_CODE_DYNAMIC_CLIENT FR_DHCP_ACK
#include <freeradius-devel/server/process.h>
RESUME(check_yiaddr)
dhcpv4_packet_debug(request, request->packet, &request->request_pairs, true);
+ if (unlikely(request_is_dynamic_client(request))) {
+ return new_client(p_result, mctx, request);
+ }
+
return state->recv(p_result, mctx, request);
}
.offset = PROCESS_CONF_OFFSET(do_not_respond),
},
+ DYNAMIC_CLIENT_SECTIONS,
+
COMPILE_TERMINATOR
};
CONF_SECTION *send_relay_reply;
CONF_SECTION *do_not_respond;
+
+ CONF_SECTION *new_client;
+ CONF_SECTION *add_client;
+ CONF_SECTION *deny_client;
} process_dhcpv6_sections_t;
typedef struct {
#define PROCESS_CODE_DO_NOT_RESPOND FR_DHCPV6_DO_NOT_RESPOND
#define PROCESS_PACKET_CODE_VALID FR_DHCPV6_PROCESS_CODE_VALID
#define PROCESS_INST process_dhcpv6_t
+#define PROCESS_CODE_DYNAMIC_CLIENT FR_DHCPV6_REPLY
/*
* DHCPv6 is nonstandard in that we reply
.component = MOD_POST_AUTH,
.offset = PROCESS_CONF_OFFSET(do_not_respond)
},
+
+ DYNAMIC_CLIENT_SECTIONS,
+
COMPILE_TERMINATOR
};
dhcpv6_packet_debug(request, request->packet, &request->request_pairs, true);
+ if (unlikely(request_is_dynamic_client(request))) {
+ return new_client(p_result, mctx, request);
+ }
+
return state->recv(p_result, mctx, request);
}