[Olsr-dev] olsrd-0.6.4 host emulation mode socket error
Vigneswaran R
(spam-protected)
Mon Feb 11 09:14:43 CET 2013
Hello,
[resending as plain text]
When I ran olsrd (0.6.4) in host emulation mode with olsr_switch, I got
the error "sendto(v4): Socket operation on non-socket".
To reproduce the error, (after doing 'make' and 'make switch')
./olsr_switch
./olsrd -f olsrd.emu.conf -hemu 10.0.0.1
To debug, I ran olsrd with 'strace' and found that socket information
(the variable 'send_socket') provided to sendto was '0' which caused the
above error. On exploring the code, realized that in host emulation mode
the 'send_socket' was not set.
Following is a small patch to resolve this problem. Thank you.
Regards,
Vignesh
olsrd_0.6.4_hemu_sock_err.patch
-------------------------------
diff -aur olsrd-0.6.4/src/unix/ifnet.c olsrd-0.6.4-patched/src/unix/ifnet.c
--- olsrd-0.6.4/src/unix/ifnet.c 2012-10-31 00:29:44.000000000 +0530
+++ olsrd-0.6.4-patched/src/unix/ifnet.c 2013-02-07 11:17:22.000000000 +0530
@@ -452,7 +452,7 @@
*on what interface the message is transmitted
*/
- ifp->olsr_socket = gethemusocket(&sin);
+ ifp->send_socket = ifp->olsr_socket = gethemusocket(&sin);
if (ifp->olsr_socket < 0) {
fprintf(stderr, "Could not initialize socket... exiting!\n\n");
More information about the Olsr-dev
mailing list