]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/blip/ICMPResponderP.nc
radv generation bug
[tinyos-2.x.git] / tos / lib / net / blip / ICMPResponderP.nc
index 3975c1b46cee1b9d8ab2bf43bbf4700d7cb2bdfd..2a9b98fa3d428756d833f25460337415cdb47271 100644 (file)
@@ -222,7 +222,9 @@ module ICMPResponderP {
 
       printfUART("beacon seqno: %i my seqno: %i\n", beacon->seqno, nd_seqno);
 
-      if (beacon->seqno > nd_seqno || (nd_seqno > 0 && beacon->seqno == 0)) {
+      if (beacon->seqno > nd_seqno || 
+          (nd_seqno > 0 && beacon->seqno == 0) ||
+          !call IPRouting.hasRoute()) {
         call IPRouting.reset();
         nd_seqno = beacon->seqno;
       }
@@ -231,8 +233,8 @@ module ICMPResponderP {
         call IPRouting.reportAdvertisement(meta->sender, r->hlim,
                                            meta->lqi, beacon->metric);
         // push out the seqno update
-        call Advertisement.stop();
-        call ICMP.sendAdvertisements();
+        // call Advertisement.stop();
+        // call ICMP.sendAdvertisements();
 
         if (pfx->type != ICMP_EXT_TYPE_PREFIX) return;
 
@@ -358,12 +360,9 @@ module ICMPResponderP {
         msg.headers = NULL;
         msg.data = payload;
         msg.data_len = len;
-        if (iph->ip6_src.s6_addr[0] == 0xfe) {
-          call IPAddress.getLLAddr(&msg.hdr.ip6_src);
-        } else {
-          call IPAddress.getIPAddr(&msg.hdr.ip6_src);
-        }
+
         memcpy(&msg.hdr.ip6_dst, &iph->ip6_src, 16);      
+        call IPAddress.setSource(&msg.hdr);
         
         req->type = ICMP_TYPE_ECHO_REPLY;
         req->code = 0;