|
@@ -259,12 +259,7 @@ Dhcpv6Srv::testServerID(const Pkt6Ptr& pkt) {
|
|
|
/// @todo Currently we always check server identifier regardless if
|
|
|
/// it is allowed in the received message or not (per RFC3315).
|
|
|
/// If the server identifier is not allowed in the message, the
|
|
|
- /// sanityCheck function should deal with it. We may rethink this
|
|
|
- /// design if we decide that it is appropriate to check at this stage
|
|
|
- /// of message processing that the server identifier must or must not
|
|
|
- /// be present. In such case however, the logic checking server id
|
|
|
- /// will have to be removed from sanityCheck and placed here instead,
|
|
|
- /// to avoid duplicate checks.
|
|
|
+ /// sanityCheck function should deal with it.
|
|
|
OptionPtr server_id = pkt->getOption(D6O_SERVERID);
|
|
|
if (server_id){
|
|
|
// Let us test received ServerID if it is same as ServerID
|
|
@@ -1970,16 +1965,9 @@ Dhcpv6Srv::extendLeases(const Pkt6Ptr& query, Pkt6Ptr& reply,
|
|
|
// Renew or Rebind message.
|
|
|
/// @todo add support for IA_TA
|
|
|
|
|
|
- /// @todo - assignLeases() drops the packet as RFC violation, shouldn't
|
|
|
- /// we do that here? Shouldn't sanityCheck defend against this? Maybe
|
|
|
- /// this should treated as a code error instead. If we're this far with
|
|
|
- /// no duid that seems wrong.
|
|
|
- if (!ctx.duid_) {
|
|
|
- // This should not happen. We have checked this before.
|
|
|
- reply->addOption(createStatusCode(*query, STATUS_UnspecFail,
|
|
|
- "You did not include mandatory client-id"));
|
|
|
- return;
|
|
|
- }
|
|
|
+ // For the lease extension it is critical that the client has sent
|
|
|
+ // DUID. There is no need to check for the presence of the DUID here
|
|
|
+ // because we have already checked it in the sanityCheck().
|
|
|
|
|
|
for (OptionCollection::iterator opt = query->options_.begin();
|
|
|
opt != query->options_.end(); ++opt) {
|
|
@@ -2466,6 +2454,8 @@ Dhcpv6Srv::processRenew(const Pkt6Ptr& renew) {
|
|
|
Pkt6Ptr
|
|
|
Dhcpv6Srv::processRebind(const Pkt6Ptr& rebind) {
|
|
|
|
|
|
+ sanityCheck(rebind, MANDATORY, FORBIDDEN);
|
|
|
+
|
|
|
// Let's create a simplified client context here.
|
|
|
AllocEngine::ClientContext6 ctx = createContext(rebind);
|
|
|
|
|
@@ -2486,6 +2476,8 @@ Dhcpv6Srv::processRebind(const Pkt6Ptr& rebind) {
|
|
|
Pkt6Ptr
|
|
|
Dhcpv6Srv::processConfirm(const Pkt6Ptr& confirm) {
|
|
|
|
|
|
+ sanityCheck(confirm, MANDATORY, FORBIDDEN);
|
|
|
+
|
|
|
// Let's create a simplified client context here.
|
|
|
AllocEngine::ClientContext6 ctx = createContext(confirm);
|
|
|
|
|
@@ -2591,6 +2583,9 @@ Dhcpv6Srv::processRelease(const Pkt6Ptr& release) {
|
|
|
|
|
|
Pkt6Ptr
|
|
|
Dhcpv6Srv::processDecline(const Pkt6Ptr& decline) {
|
|
|
+
|
|
|
+ sanityCheck(decline, MANDATORY, MANDATORY);
|
|
|
+
|
|
|
/// @todo: Implement this
|
|
|
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, decline->getTransid()));
|
|
|
return (reply);
|
|
@@ -2599,6 +2594,8 @@ Dhcpv6Srv::processDecline(const Pkt6Ptr& decline) {
|
|
|
Pkt6Ptr
|
|
|
Dhcpv6Srv::processInfRequest(const Pkt6Ptr& inf_request) {
|
|
|
|
|
|
+ sanityCheck(inf_request, OPTIONAL, OPTIONAL);
|
|
|
+
|
|
|
// Let's create a simplified client context here.
|
|
|
AllocEngine::ClientContext6 ctx = createContext(inf_request);
|
|
|
|