X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=support%2Fsdk%2Fc%2Fblip%2Flib6lowpan%2Flib6lowpanIP.c;h=d16f9bdd6e44a51b7a3efd22e9ffafaafa9ddccd;hb=167699cbf159e22a08c14a46fd2c68c72b09c10a;hp=54a70e89e5627dc71ce25b4759ab0c08c8483392;hpb=e1526e289da030ff214b8ee978c564289a207a53;p=tinyos-2.x.git diff --git a/support/sdk/c/blip/lib6lowpan/lib6lowpanIP.c b/support/sdk/c/blip/lib6lowpan/lib6lowpanIP.c index 54a70e89..d16f9bdd 100644 --- a/support/sdk/c/blip/lib6lowpan/lib6lowpanIP.c +++ b/support/sdk/c/blip/lib6lowpan/lib6lowpanIP.c @@ -30,7 +30,6 @@ */ uint8_t linklocal_prefix [] = {0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -uint8_t multicast_prefix [] = {0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; struct in6_addr __my_address = {{{0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65}}}; @@ -134,8 +133,10 @@ static inline int decompressShortAddress(uint8_t dispatch, uint8_t *s_addr, uint } // otherwise we either have an invalid compression, or else it's a // multicast address - ip_memcpy(dest, multicast_prefix, 8); - ip_memclr(dest + 8, 8); + // ip_memcpy(dest, multicast_prefix, 8); + ip_memclr(dest, 16); + dest[0] = 0xff; + dest[1] = 0x02; switch (*s_addr & LOWPAN_IPHC_SHORT_LONG_MASK) { case LOWPAN_IPHC_HC1_MCAST: dest[14] = (*s_addr) & ~LOWPAN_IPHC_SHORT_LONG_MASK; @@ -483,7 +484,8 @@ uint8_t packHeaders(struct split_ip_msg *msg, } nxt_hdr = hdr->nxt_hdr; - if (hdr->nxt_hdr == IANA_UDP /* or other compressed values... */) { + if (hdr->nxt_hdr == IANA_UDP && /* or other compressed values... */ + msg->headers != NULL) { // we will add the HCNH encoding at the end of the header *encoding |= LOWPAN_IPHC_NH_MASK; } else { @@ -618,8 +620,10 @@ void inet_pton6(char *addr, struct in6_addr *dest) { cur = 0; } p++; - if (*p == '\0') + if (*p == '\0') { + dest->s6_addr16[block++] = hton16(cur); return; + } if (*(p - 1) == ':' && *p == ':') { break; }