The following commit has been merged in the master branch: commit 9318c6c19ff357467613b0f012857c013c2d768d Author: Marek Lindner lindner_marek@yahoo.de Date: Mon Sep 11 17:52:02 2006 +0200
gateway debug
diff --git a/batman.c b/batman.c index b64539a..aec8f71 100755 --- a/batman.c +++ b/batman.c @@ -175,7 +175,8 @@ static void choose_gw() static char orig_str[ADDR_STR_LEN];
- if ( routing_class == 0 ) return; + if ( routing_class == 0 ) + return;
if ( list_empty(&gw_list) ) {
@@ -384,8 +385,8 @@ static void update_gw_list( struct orig_node *orig_node, unsigned char new_gwfla
}
- if (debug_level >= 0) { - addr_to_string( gw_node->orig_node->orig, orig_str, ADDR_STR_LEN ); + if (debug_level >= 1) { + addr_to_string( orig_node->orig, orig_str, ADDR_STR_LEN ); output( "Found new gateway %s with class %i\n", orig_str, new_gwflags ); }
@@ -394,10 +395,10 @@ static void update_gw_list( struct orig_node *orig_node, unsigned char new_gwfla INIT_LIST_HEAD(&gw_node->list);
gw_node->orig_node = orig_node; - choose_gw(); - list_add_tail(&gw_node->list, &gw_list);
+ choose_gw(); + }
static void debug() @@ -410,7 +411,7 @@ static void debug() static char str[ADDR_STR_LEN]; int l;
- if (debug_level < 1) + if (debug_level < 2) return;
if (debug_level >= 2) { diff --git a/posix.c b/posix.c index 1696a56..1c58bf2 100644 --- a/posix.c +++ b/posix.c @@ -235,7 +235,7 @@ void del_default_route() {
curr_gateway = NULL;
- add_del_route( 0, curr_gateway_ip, 1, curr_gateway_ipip_if, curr_gateway_ipip_fd ); +// add_del_route( 0, curr_gateway_ip, 1, curr_gateway_ipip_if, curr_gateway_ipip_fd );
close( curr_gateway_tcp_sock ); del_ipip_tun( curr_gateway_ipip_fd ); @@ -284,7 +284,7 @@ int add_default_route() {
if ( add_ipip_tun( curr_gateway_batman_if, curr_gateway_ip, curr_gateway_ipip_if, &curr_gateway_ipip_fd ) > 0 ) {
- add_del_route( 0, curr_gateway_ip, 0, curr_gateway_ipip_if, curr_gateway_ipip_fd ); +// add_del_route( 0, curr_gateway_ip, 0, curr_gateway_ipip_if, curr_gateway_ipip_fd ); return 1;
} else {