X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2Fblip%2FUdpP.nc;h=cc80065273e939699cccbd53c2cb887c0e08c5fb;hb=b5f791c14df3d1a9bfebf2a49440ac118438c5fd;hp=fa43a549e1655631d60db89e09c25230ed0ed086;hpb=c76f0ecb25bc766d836b79552b1659b7a7465b56;p=tinyos-2.x.git diff --git a/tos/lib/net/blip/UdpP.nc b/tos/lib/net/blip/UdpP.nc index fa43a549..cc800652 100644 --- a/tos/lib/net/blip/UdpP.nc +++ b/tos/lib/net/blip/UdpP.nc @@ -53,16 +53,6 @@ module UdpP { return SUCCESS; } - void setSrcAddr(struct split_ip_msg *msg) { - if (msg->hdr.ip6_dst.s6_addr16[7] == htons(0xff02) || - msg->hdr.ip6_dst.s6_addr16[7] == htons(0xfe80)) { - call IPAddress.getLLAddr(&msg->hdr.ip6_src); - } else { - call IPAddress.getIPAddr(&msg->hdr.ip6_src); - } - } - - command error_t UDP.bind[uint8_t clnt](uint16_t port) { int i; port = htons(port); @@ -157,7 +147,7 @@ module UdpP { ip_memclr((uint8_t *)msg, sizeof(struct split_ip_msg)); ip_memclr((uint8_t *)udp, sizeof(struct udp_hdr)); - setSrcAddr(msg); + call IPAddress.setSource(&msg->hdr); memcpy(&msg->hdr.ip6_dst, dest->sin6_addr.s6_addr, 16); if (local_ports[clnt] == 0 && (local_ports[clnt] = alloc_lport(clnt)) == 0) {