That trouble was solved setting the socket to non-blocking mode.

--- sfsource-orig.c 2012-04-17 13:53:28.000000000 -0300
+++ sfsource.c 2012-04-17 13:48:55.000000000 -0300
@@ -6,6 +6,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
+#include <fcntl.h>

 #include "sfsource.h"

@@ -84,6 +85,13 @@
       return -1;
     }

+  /**
+   * set socket in non-blocking mode
+   */
+  int flags;
+  if (-1 == (flags = fcntl(fd, F_GETFL, 0))) flags = 0;
+  fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+
   return fd;
 }

Finally it seems to work!

----
*Maycon Maia Vitali* (aka 0ut0fBound)
Offensive Security Certified Expert (OSCE)
Security Researcher @ Hack'n Roll
http://maycon.hacknroll.com
Hack'n Roll



2012/4/17 Maycon Maia Vitali <[email protected]>

> I notice that ip-driver is locked on read_sf_packet call:
>
> (gdb) bt
> #0  0x00007ffff7b120f0 in __read_nocancel () from /lib/libc.so.6
> #1  0x000000000040cf08 in saferead (fd=9, buffer=0x7fffffffdf3f, count=1)
>     at sfsource.c:18
> #2  0x000000000040d0de in read_sf_packet (fd=9, len=0x7fffffffe4d8)
>     at sfsource.c:131
> #3  0x0000000000403bee in serial_input () at serial_tun.c:1025
> #4  0x0000000000404122 in serial_tunnel (tun_fd=8) at serial_tun.c:1360
> #5  0x00000000004020d1 in main (argc=<optimized out>, argv=0x7fffffffe718)
>     at serial_tun.c:1492
> (gdb)
>
> Anybody has some idea to solve this?
>
> ----
> *Maycon Maia Vitali* (aka 0ut0fBound)
> Offensive Security Certified Expert (OSCE)
> Security Researcher @ Hack'n Roll
> http://maycon.hacknroll.com
> Hack'n Roll
>
>
>
> 2012/4/17 Christian Haas <[email protected]>
>
>> On 04/17/2012 02:18 PM, Maycon Maia Vitali wrote:
>> > Hello Christian,
>> > *
>> > *
>> > What version did you simulate? BLIP 2.0 on Micaz? The last version is
>> too
>> > big to compile for Micaz platform. Running in physical node, it works
>> just
>> > on telosb platform.
>> >
>>
>> BLIP 1.x, not sure which SVN Rev. I used. I used a modified avr-gcc to
>> get rid of the RAM/ROM problems on MicaZ, so yes i used MicaZ
>>
>> > Did you used SF_SRC too? How do you communicate with network? Did you
>> use
>> > IPBaseStation or a serial communication with each node? I would like to
>> > connect in BaseStation using nc6 and access any node in same way. Is
>> that
>> > possible?
>>
>> Yes i used SF_SRC, too. We used ip-driver + SerialForwarder +
>> IPBaseStation. I was able to use ping6 as far as i remember.
>> >
>> > Someone already used the socat tool to create a virtual device to use
>> > between avrora and some another application that uses just linux
>> devices?
>>
>> Dunno.
>>
>> Regards,
>>  Christian
>>
>>
>> --
>> Dipl. Inform. Christian Haas
>> Karlsruher Institut für Technologie
>> TM Prof. Dr. Zitterbart
>> Raum 102, Geb. 20.50
>> Engesserstraße 2 Rechts
>> 76128 Karlsruhe
>> Germany
>>
>> Tel.: +49 721 608-48673
>> Email:[email protected]
>> Jabber-ID: [email protected]
>>
>>
>>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to