[Tinyos-2-commits] [tinyos-main] r5741 committed - accept Issue 64

tinyos-main at googlecode.com tinyos-main at googlecode.com
Thu Sep 15 18:45:21 PDT 2011


Revision: 5741
Author:   sdhags
Date:     Thu Sep 15 18:44:05 2011
Log:      accept Issue 64

http://code.google.com/p/tinyos-main/source/detail?r=5741

Modified:
  /trunk/tos/lib/net/blip/dhcp/Dhcp6ClientP.nc

=======================================
--- /trunk/tos/lib/net/blip/dhcp/Dhcp6ClientP.nc	Mon Jun  6 12:47:23 2011
+++ /trunk/tos/lib/net/blip/dhcp/Dhcp6ClientP.nc	Thu Sep 15 18:44:05 2011
@@ -318,17 +318,18 @@
            return;

          // see if there's an error code
-        status = findOption(ia + 1, ntohs(ia->len) - sizeof(struct  
dh6_ia), 13);
+        status = findOption(ia + 1, ntohs(ia->len) + sizeof(struct  
dh6_opt_header) - sizeof(struct dh6_ia), 13);
          if (status) {
            if (status->code != htons(0)) {
-            m_state = DH6_SOLICIT;
+            m_state = (m_state == DH6_RENEW) ? DH6_REQUEST : DH6_SOLICIT;
              call IPAddress.removeAddress();
+            call Timer.startOneShot (0); // attempt immediate recovery
              return;
            }
          }

          // otherwise, hopefully there's an address
-        addr_opt = findOption(ia + 1, ntohs(ia->len) - sizeof(struct  
dh6_ia), 5);
+        addr_opt = findOption(ia + 1, ntohs(ia->len) + sizeof(struct  
dh6_opt_header) - sizeof(struct dh6_ia), 5);
          if (addr_opt) {
            struct dh6_iaaddr *addr = addr_opt;
            // got an address... save it and wait for it to expire


More information about the Tinyos-2-commits mailing list