]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/blip/TcpP.nc
- update blip source address setting to be more generic
[tinyos-2.x.git] / tos / lib / net / blip / TcpP.nc
index 02c42aff7f80b66eb8c3b0e9ed598dca14ddab38..4ade476c94f5a746cce999e839c3c5d471154d28 100644 (file)
@@ -60,15 +60,6 @@ module TcpP {
 #include "circ.c"
 #include "tcplib.c"
 
-  void setSrcAddr(struct split_ip_msg *msg) {
-    if (msg->hdr.ip6_dst.s6_addr16[0] == htons(0xff02) ||
-        msg->hdr.ip6_dst.s6_addr16[0] == htons(0xfe80)) {
-      call IPAddress.getLLAddr(&msg->hdr.ip6_src);
-    } else {
-      call IPAddress.getIPAddr(&msg->hdr.ip6_src);
-    }
-  }
-
   struct tcplib_sock socks[uniqueCount("TCP_CLIENT")];
 
   struct tcplib_sock *tcplib_accept(struct tcplib_sock *conn,
@@ -87,7 +78,7 @@ module TcpP {
 
   void tcplib_send_out(struct split_ip_msg *msg, struct tcp_hdr *tcph) {
     printfUART("tcp output\n");
-    setSrcAddr(msg);
+    call IPAddress.setSource(&msg->hdr);
     tcph->chksum = htons(msg_cksum(msg, IANA_TCP));
     call IP.send(msg);
   }