The following commit has been merged in the master branch: commit 24b5c7330675ef6a1f0383e8738939fd973a1022 Author: Marek Lindner lindner_marek@yahoo.de Date: Wed Sep 6 23:00:37 2006 +0200
unidirec debug
diff --git a/batman.c b/batman.c index cc59d1a..0a047e1 100755 --- a/batman.c +++ b/batman.c @@ -596,9 +596,9 @@ void schedule_forward_packet( struct packet *in, int unidirectional, struct ori if (in->ttl <= 1) { if (debug_level >= 2) output("ttl exceeded \n"); - } else if ( ( orig_node->router != neigh ) && ( orig_node->router != 0 ) ) { +/* } else if ( ( orig_node->router != neigh ) && ( orig_node->router != 0 ) ) { if (debug_level >= 2) - output("not my best neighbour\n"); + output("not my best neighbour\n");*/ } else { forw_node_new = alloc_memory(sizeof (struct forw_node)); INIT_LIST_HEAD(&forw_node_new->list); @@ -925,24 +925,24 @@ int batman() orig_neigh_node = update_last_hop( &in, neigh );
/* we are forwarding duplicate o-packets if they come via our best neighbour and ttl is valid */ - if ( ( is_duplicate ) && ( ( orig_neigh_node->router == neigh ) || ( orig_neigh_node->router == 0 ) ) ) { - - list_for_each(neigh_pos, &orig_neigh_node->neigh_list) { - - neigh_node = list_entry(neigh_pos, struct neigh_node, list); - - if ( neigh_node->addr == neigh ) { - - if ( neigh_node->best_ttl == in.ttl ) - forward_duplicate_packet = 1; - - break; - - } - - } - - } +// if ( ( is_duplicate ) && ( ( orig_neigh_node->router == neigh ) || ( orig_neigh_node->router == 0 ) ) ) { +// +// list_for_each(neigh_pos, &orig_neigh_node->neigh_list) { +// +// neigh_node = list_entry(neigh_pos, struct neigh_node, list); +// +// if ( neigh_node->addr == neigh ) { +// +// if ( neigh_node->best_ttl == in.ttl ) +// forward_duplicate_packet = 1; +// +// break; +// +// } +// +// } +// +// }
if (debug_level >= 0) { if ( is_duplicate ) diff --git a/posix.c b/posix.c index 71daf64..03c619c 100644 --- a/posix.c +++ b/posix.c @@ -246,25 +246,25 @@ void *gw_listen( void *arg ) { socklen_t sin_size = sizeof(struct sockaddr_in); char str1[16], str2[16]; int res, max_sock; - fd_set wait_sockets; - + fd_set wait_sockets, tmp_wait_sockets;
+ FD_ZERO(&wait_sockets); + FD_SET(batman_if->tcp_gw_sock, &wait_sockets); max_sock = batman_if->tcp_gw_sock;
while (!is_aborted()) {
tv.tv_sec = 1; tv.tv_usec = 0; + tmp_wait_sockets = wait_sockets;
- FD_ZERO(&wait_sockets); - FD_SET(batman_if->tcp_gw_sock, &wait_sockets); - res = select(max_sock + 1, &wait_sockets, NULL, NULL, &tv); + res = select(max_sock + 1, &tmp_wait_sockets, NULL, NULL, &tv);
if (res > 0) {
/* new client */ - if ( FD_ISSET( batman_if->tcp_gw_sock, &wait_sockets ) ) { + if ( FD_ISSET( batman_if->tcp_gw_sock, &tmp_wait_sockets ) ) {
gw_client = alloc_memory(sizeof(struct gw_client)); memset(gw_client, 0, sizeof(struct gw_client));