The following commit has been merged in the master branch: commit 981d5c2ff81a773b6d17708ef4f8a2319575e240 Author: Marek Lindner lindner_marek@yahoo.de Date: Thu Dec 7 16:41:56 2006 +0100
non-primary interfaces do not send hna information II
diff --git a/batman.c b/batman.c index 047f5cc..ee74227 100644 --- a/batman.c +++ b/batman.c @@ -812,6 +812,7 @@ void schedule_forward_packet( struct packet *in, int unidirectional, int directl
((struct packet *)forw_node_new->pack_buff)->ttl--; forw_node_new->when = get_time(); + forw_node_new->own = 0;
forw_node_new->if_outgoing = if_outgoing;
@@ -901,7 +902,7 @@ void send_outstanding_packets() { output( "Forwarding packet (originator %s, seqno %d, TTL %d) on interface %s\n", orig_str, ((struct packet *)forw_node->pack_buff)->seqno, ((struct packet *)forw_node->pack_buff)->ttl, batman_if->dev );
/* non-primary interfaces do not send hna information */ - if ( ( batman_if->if_num > 1 ) && ( forw_node->own ) ) { + if ( ( forw_node->own ) && ( ((struct packet *)forw_node->pack_buff)->orig != ((struct batman_if *)if_list.next)->addr.sin_addr.s_addr ) ) {
if ( send_packet( forw_node->pack_buff, sizeof(struct packet), &batman_if->broad, batman_if->udp_send_sock ) < 0 ) { exit( -1 ); @@ -954,7 +955,7 @@ void schedule_own_packet() {
forw_node_new->when = curr_time + rand_num( JITTER ); forw_node_new->if_outgoing = NULL; - forw_node_new->own++; + forw_node_new->own = 1;
if ( num_hna > 0 ) {
diff --git a/batman.h b/batman.h index 2e46f73..d62a456 100644 --- a/batman.h +++ b/batman.h @@ -24,7 +24,7 @@ #include <pthread.h> #include "list.h"
-#define VERSION "0.1 rc 6b" +#define VERSION "0.1 rc6" #define BATMAN_VERSION 1 #define PORT 1966 #define UNIDIRECTIONAL 0x80 @@ -77,12 +77,12 @@ struct orig_node /* structure for orig_list maintaining nodes of unsigned int orig; unsigned int router; struct batman_if *batman_if; - unsigned int packet_count; /* packets gathered from its router */ - unsigned int last_seen; /* when last originator packet (with new seq-number) from this node was received */ + unsigned int packet_count; /* packets gathered from its router */ + unsigned int last_seen; /* when last originator packet (with new seq-number) from this node was received */ unsigned int *last_reply; /* if node is a neighbour, when my originator packet was last broadcasted (replied) by this node and received by me */ - unsigned int last_aware; /* if node is a neighbour, when last packet via this node was received */ + unsigned int last_aware; /* if node is a neighbour, when last packet via this node was received */ unsigned char flags; - unsigned char gwflags; /* flags related to gateway functions: gateway class */ + unsigned char gwflags; /* flags related to gateway functions: gateway class */ unsigned char *hna_buff; int hna_buff_len; struct list_head neigh_list; @@ -163,10 +163,6 @@ struct vis_if { struct sockaddr_in addr; };
-/* -static void update_routes(); -static void debug(); -*/
int batman();