Browse Source

[master] Unit-test fix after #3555 merge.

Tomek Mrugalski 10 years ago
parent
commit
98a7ffb5c7
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/bin/dhcp6/tests/dhcp6_client.cc

+ 8 - 2
src/bin/dhcp6/tests/dhcp6_client.cc

@@ -61,6 +61,10 @@ Dhcp6Client::applyRcvdConfiguration(const Pkt6Ptr& reply) {
     // Get all options in the reply message and pick IA_NA, IA_PD and
     // Get all options in the reply message and pick IA_NA, IA_PD and
     // Status code.
     // Status code.
     Opts opts = reply->options_;
     Opts opts = reply->options_;
+
+    // Let's try to get a MAC
+    HWAddrPtr hwaddr = reply->getMAC(Pkt::HWADDR_SOURCE_ANY);
+
     // Set the global status code to default: success and not received.
     // Set the global status code to default: success and not received.
     config_.resetGlobalStatusCode();
     config_.resetGlobalStatusCode();
     for (Opts::const_iterator opt = opts.begin(); opt != opts.end(); ++opt) {
     for (Opts::const_iterator opt = opts.begin(); opt != opts.end(); ++opt) {
@@ -88,12 +92,14 @@ Dhcp6Client::applyRcvdConfiguration(const Pkt6Ptr& reply) {
                         lease_info.lease_.iaid_ = ia->getIAID();
                         lease_info.lease_.iaid_ = ia->getIAID();
                         break;
                         break;
                     }
                     }
+
                     lease_info.lease_ = Lease6(Lease::TYPE_NA,
                     lease_info.lease_ = Lease6(Lease::TYPE_NA,
                                                iaaddr->getAddress(),
                                                iaaddr->getAddress(),
                                                duid_, ia->getIAID(),
                                                duid_, ia->getIAID(),
                                                iaaddr->getPreferred(),
                                                iaaddr->getPreferred(),
                                                iaaddr->getValid(),
                                                iaaddr->getValid(),
-                                               ia->getT1(), ia->getT2(), 0);
+                                               ia->getT1(), ia->getT2(), 0,
+                                               hwaddr);
                     lease_info.lease_.cltt_ = time(NULL);
                     lease_info.lease_.cltt_ = time(NULL);
                 }
                 }
                 break;
                 break;
@@ -117,7 +123,7 @@ Dhcp6Client::applyRcvdConfiguration(const Pkt6Ptr& reply) {
                                                iaprefix->getPreferred(),
                                                iaprefix->getPreferred(),
                                                iaprefix->getValid(),
                                                iaprefix->getValid(),
                                                ia->getT1(), ia->getT2(), 0,
                                                ia->getT1(), ia->getT2(), 0,
-                                               HWAddrPtr(),
+                                               hwaddr,
                                                iaprefix->getLength());
                                                iaprefix->getLength());
                     lease_info.lease_.cltt_ = time(NULL);
                     lease_info.lease_.cltt_ = time(NULL);
                 }
                 }