Index: src/unix/ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.27 diff -c -r1.27 ifnet.c *** src/unix/ifnet.c 30 May 2005 13:13:47 -0000 1.27 --- src/unix/ifnet.c 21 Jun 2005 23:09:05 -0000 *************** *** 703,708 **** --- 703,709 ---- int precedence = IPTOS_PREC(olsr_cnf->tos); int tos_bits = IPTOS_TOS(olsr_cnf->tos); #endif + union olsr_ip_addr saved_addr; if(iface->host_emul) return -1; *************** *** 905,913 **** *the socket to it. This to ensure that we can control *on what interface the message is transmitted */ ifp->olsr_socket = getsocket((struct sockaddr *)&addrsock, bufspace, ifp->int_name); ! if (ifp->olsr_socket < 0) { fprintf(stderr, "Could not initialize socket... exiting!\n\n"); --- 906,919 ---- *the socket to it. This to ensure that we can control *on what interface the message is transmitted */ + + COPY_IP(&saved_addr, &addrsock.sin_addr.s_addr); + COPY_IP(&addrsock.sin_addr.s_addr, &ifp->ip_addr); ifp->olsr_socket = getsocket((struct sockaddr *)&addrsock, bufspace, ifp->int_name); ! ! COPY_IP(&addrsock.sin_addr.s_addr, &saved_addr); ! if (ifp->olsr_socket < 0) { fprintf(stderr, "Could not initialize socket... exiting!\n\n"); *************** *** 927,934 **** --- 933,945 ---- *the socket to it. This to ensure that we can control *on what interface the message is transmitted */ + + COPY_IP(&saved_addr, &addrsock6.sin6_addr); + COPY_IP(&addrsock6.sin6_addr, &ifp->ip_addr); ifp->olsr_socket = getsocket6(&addrsock6, bufspace, ifp->int_name); + + COPY_IP(&addrsock6.sin6_addr, &saved_addr); join_mcast(ifp, ifp->olsr_socket);