The following commit has been merged in the master branch: commit 9f6a44547b6e333207716c1b640a115f4ca0eeb5 Author: Marek Lindner lindner_marek@yahoo.de Date: Tue Sep 12 10:02:41 2006 +0200
choose_gw activated and ipip tunnel fcts added IV
diff --git a/posix.c b/posix.c index 937768e..56b8881 100644 --- a/posix.c +++ b/posix.c @@ -164,7 +164,7 @@ int add_ipip_tun( struct batman_if *batman_if, unsigned int dest_addr, char *tun return -1;
} - printf( "1\n" ); + if ( ( ioctl( *fd, TUNSETIFF, (void *) &ifr ) ) < 0 ) {
perror("TUNSETIFF"); @@ -172,7 +172,7 @@ int add_ipip_tun( struct batman_if *batman_if, unsigned int dest_addr, char *tun return -1;
} - printf( "2\n" ); + if ( ioctl( *fd, TUNSETPERSIST, 1 ) < 0 ) {
perror("TUNSETPERSIST"); @@ -181,7 +181,7 @@ int add_ipip_tun( struct batman_if *batman_if, unsigned int dest_addr, char *tun
}
- printf( "3\n" ); + tmp_fd = socket(AF_INET, SOCK_DGRAM, 0);
if ( tmp_fd < 0 ) { @@ -197,7 +197,7 @@ int add_ipip_tun( struct batman_if *batman_if, unsigned int dest_addr, char *tun addr.sin_family = AF_INET; memcpy( &ifr.ifr_addr, &addr, sizeof(struct sockaddr) );
- printf( "4\n" ); + if ( ioctl( tmp_fd, SIOCSIFADDR, &ifr) < 0 ) {
perror("SIOCSIFADDR"); @@ -206,7 +206,7 @@ int add_ipip_tun( struct batman_if *batman_if, unsigned int dest_addr, char *tun return -1;
} - printf( "5\n" ); + /* set ip of this remote point of tunnel */ memset( &addr, 0, sizeof(addr) ); addr.sin_addr.s_addr = dest_addr;