OptionPtr
Dhcpv6Srv::renewIA_NA(const Subnet6Ptr& subnet, const DuidPtr& duid,
- const Pkt6Ptr& query, boost::shared_ptr<Option6IA> ia,
- const Option6ClientFqdnPtr& fqdn) {
+ const Pkt6Ptr& query, const Pkt6Ptr& answer,
+ boost::shared_ptr<Option6IA> ia) {
if (!subnet) {
// There's no subnet select for this client. There's nothing to renew.
boost::shared_ptr<Option6IA> ia_rsp(new Option6IA(D6O_IA_NA, ia->getIAID()));
// the update.
bool do_fwd = false;
bool do_rev = false;
+ Option6ClientFqdnPtr fqdn = boost::dynamic_pointer_cast<
+ Option6ClientFqdn>(answer->getOption(D6O_CLIENT_FQDN));
if (fqdn) {
if (fqdn->getFlag(Option6ClientFqdn::FLAG_S)) {
do_fwd = true;
}
void
-Dhcpv6Srv::renewLeases(const Pkt6Ptr& renew, Pkt6Ptr& reply,
- const Option6ClientFqdnPtr& fqdn) {
+Dhcpv6Srv::renewLeases(const Pkt6Ptr& renew, Pkt6Ptr& reply) {
// We need to renew addresses for all IA_NA options in the client's
// RENEW message.
switch (opt->second->getType()) {
case D6O_IA_NA: {
- OptionPtr answer_opt = renewIA_NA(subnet, duid, renew,
+ OptionPtr answer_opt = renewIA_NA(subnet, duid, renew, reply,
boost::dynamic_pointer_cast<
- Option6IA>(opt->second),
- fqdn);
+ Option6IA>(opt->second));
if (answer_opt) {
reply->addOption(answer_opt);
}
appendRequestedOptions(renew, reply);
Option6ClientFqdnPtr fqdn = processClientFqdn(renew, reply);
- renewLeases(renew, reply, fqdn);
+ renewLeases(renew, reply);
createNameChangeRequests(reply);
return (reply);
/// @param subnet subnet the sender belongs to
/// @param duid client's duid
/// @param query client's message
+ /// @param answer server's response to the client's message. This
+ /// message should contain Client FQDN option being sent by the server
+ /// to the client (if the client sent this option to the server).
/// @param ia IA_NA option that is being renewed
/// @param fqdn DHCPv6 Client FQDN Option included in the server's response
/// @return IA_NA option (server's response)
OptionPtr renewIA_NA(const Subnet6Ptr& subnet, const DuidPtr& duid,
- const Pkt6Ptr& query, boost::shared_ptr<Option6IA> ia,
- const Option6ClientFqdnPtr& fqdn);
+ const Pkt6Ptr& query, const Pkt6Ptr& answer,
+ boost::shared_ptr<Option6IA> ia);
/// @brief Renews specific IA_PD option
///
/// as IA_NA/IAADDR to reply packet.
/// @param renew client's message asking for renew
/// @param reply server's response
- /// @param fqdn A DHCPv6 Client FQDN %Option generated in the response to the
- /// client's FQDN option.
- void renewLeases(const Pkt6Ptr& renew, Pkt6Ptr& reply,
- const Option6ClientFqdnPtr& fqdn);
+ void renewLeases(const Pkt6Ptr& renew, Pkt6Ptr& reply);
/// @brief Attempts to release received addresses
///