Re: [B.A.T.M.A.N.] BATGAT

2008-09-12 Thread Gustavo Lindberg
I just tried the last openwrt-kamikaze trunk with the svn v1109 of batman on
ubnt NS2. Batmand die as follows:

 r...@openwrt:~# batmand -d 4 -g 5000 ath2
WARNING: You are using the unstable batman branch. If you are interested in
*using* batman get the latest stable release !
Interface activated: ath2
Using interface ath2 with address 5.0.0.1 and broadcast address
5.255.255.255
B.A.T.M.A.N. 0.3-beta (compatibility version 5)
[80] Error - can't set IFFLAGS for gate0: Cannot assign requested
address
[80] Error - can't set IFFLAGS for gate0: Cannot assign requested
address


dmesg output:

Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps
24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_ahb: wifi0: Atheros 2315 WiSoC: mem=0xb000, irq=3
gpio-buttons driver version 0.1.1
batgat: [batgat_ioctl:224] name gate0 index 7
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
batgat: [batgat_ioctl:224] name gate0 index 8
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
batgat: [batgat_ioctl:224] name gate0 index 9
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
batgat: [batgat_ioctl:224] name gate0 index 10
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
r...@openwrt:~#
No iptables rules at all. All policy ACCEPT.

BATGAT dont crash anymore, Keep live.



Greetings.
Gustavo.

2008/9/11 Marek Lindner 

> On Thursday, 11. September 2008 05:00:59 Gustavo Lindberg wrote:
> > I am experimenting very frustrating issues with batgat. Currently i am
> > testing the last trunk of kamikaze on ubiquity NS2. Batmand dies quietly
> > with batgat loaded. I will prove the last kamikaze on two NS2 without
> > batgat and inform the bug  if this error happen again.
>
> I think it would be intersting to find out why batmand dies. May be you
> could
> produce a core dump ?
> Indeed, we have a problem if the batman daemon dies without telling the
> module. What about adding a keep alive + timeout in the module ?
>
> Greetings,
> Marek
>  ___
> B.A.T.M.A.N mailing list
> b.a.t.m@open-mesh.net
> https://list.open-mesh.net/mm/listinfo/b.a.t.m.a.n
>


Re: [B.A.T.M.A.N.] Batman never stabilizes a route for nodes

2008-09-12 Thread Marek Lindner
On Thursday, 11. September 2008 21:01:11 Outback Dingo wrote:
> Batmand never established a stable route for clients, ie. they never get
> reliable internet, actually to be honest, they get 0 internet cause routing
> always loops

Please be precise here: Do you see routing loops or is your UDP connection not 
stable (as indicated by your log) ?


> i also found this thread from before showing a similiar issue
>
> https://list.open-mesh.net/pipermail/b.a.t.m.a.n/2007-September/000277.html

This may or may not apply here. I have a look into the code later. Do you use 
different hardware for your gateways and clients or always the same ?


> question is how do i get the routes to stabilize so the mesh functions

As I mentioned before we need a tcpdump of your traffic to help you. Even 
better would be a wireshark log from both ends that we can analyze.

Greetings,
Marek



Re: [B.A.T.M.A.N.] [PATCH] Remove batgat proc entries correctly

2008-09-12 Thread Marek Lindner
On Thursday, 11. September 2008 21:53:27 Sven Eckelmann wrote:
> We must remove the /proc/net/batgat/clients file and /proc/net/batgat dir
> correctly or otherwise we will get a oops when someone tries to access the
> file. If we do not remove the directory it is possible that more then one
> batgat entry appears inside of /proc/net/

Your patches look very good. Nice catch !
Simon already applied them. 

Thanks,
Marek


Re: [B.A.T.M.A.N.] BATGAT

2008-09-12 Thread Marek Lindner
On Friday, 12. September 2008 06:18:58 Gustavo Lindberg wrote:
> B.A.T.M.A.N. 0.3-beta (compatibility version 5)

It seems you are using an older version of the daemon together with the kernel 
module. "0.3-beta" may not be compatible with the latest kernel module.


> [80] Error - can't set IFFLAGS for gate0: Cannot assign requested
> address
> [80] Error - can't set IFFLAGS for gate0: Cannot assign requested
> address

It does not crash here but exits because it can't set the IP address. 

Please update to the latest versions first.

Greetings,
Marek


Re: [B.A.T.M.A.N.] Batman never stabilizes a route for nodes

2008-09-12 Thread Outback Dingo
ok, im getting tcpdumps, this is a test bed of the same hardward atheros
based Ubiquity NS2 devices running OpenWRT trunk
1 gateway -> 70 meters -> 1 node
no batgat, batmand running
it goes into this constant loop as shown in

http://pastebin.com/md162302 which is from last night 10PM

where the gateway and node continuously go into this ip expired loop for
5-15 minutes
causing routing for clients to go away, and network unstability, then it
appears to come back for a while

I also have 21 nodes, same hardware, running batgat which still crashed as
Gustavo pointed out
of which the logs were forwarded, the test bed has been setup to remove
batgat and look for stability

im tcpdumping on both client and gateway now, ill forward the result of
these logs in a bit
as for wireshark ill make a build with that and see if i can get these logs
also

On Fri, Sep 12, 2008 at 9:31 AM, Marek Lindner wrote:

> On Thursday, 11. September 2008 21:01:11 Outback Dingo wrote:
> > Batmand never established a stable route for clients, ie. they never get
> > reliable internet, actually to be honest, they get 0 internet cause
> routing
> > always loops
>
> Please be precise here: Do you see routing loops or is your UDP connection
> not
> stable (as indicated by your log) ?
>
>
> > i also found this thread from before showing a similiar issue
> >
> >
> https://list.open-mesh.net/pipermail/b.a.t.m.a.n/2007-September/000277.html
>
> This may or may not apply here. I have a look into the code later. Do you
> use
> different hardware for your gateways and clients or always the same ?
>
>
> > question is how do i get the routes to stabilize so the mesh functions
>
> As I mentioned before we need a tcpdump of your traffic to help you. Even
> better would be a wireshark log from both ends that we can analyze.
>
> Greetings,
> Marek
>
> ___
> B.A.T.M.A.N mailing list
> b.a.t.m@open-mesh.net
> https://list.open-mesh.net/mm/listinfo/b.a.t.m.a.n
>


Re: [B.A.T.M.A.N.] Batman never stabilizes a route for nodes

2008-09-12 Thread Marek Lindner
On Friday, 12. September 2008 11:12:21 Outback Dingo wrote:
> ok, im getting tcpdumps, this is a test bed of the same hardward atheros
> based Ubiquity NS2 devices running OpenWRT trunk

Then it is not related to your hw and the link posted earlier does not help 
here.


> http://pastebin.com/md162302 which is from last night 10PM

Your log is pretty interesting. It shows that the basic functionality is there 
but does not work reliably. The gateway is sending the keep alive reply to 
the client which further indicates that we don't have an endianess issue 
here.


> I also have 21 nodes, same hardware, running batgat which still crashed as
> Gustavo pointed out
> of which the logs were forwarded, the test bed has been setup to remove
> batgat and look for stability

Do you intend to test the latest stability patches from Sven ? May be it 
solves your problem. It would be interesting to find out why the network is 
less flaky if you use the module.


> im tcpdumping on both client and gateway now, ill forward the result of
> these logs in a bit
> as for wireshark ill make a build with that and see if i can get these logs
> also

Cool !

Greetings,
Marek


[B.A.T.M.A.N.] Batmand dies

2008-09-12 Thread Gustavo Lindberg
I just tried the last openwrt-kamikaze trunk with the svn v1109 of batman on
ubnt NS2. Batmand die as follows:

 r...@openwrt:~# batmand -d 4 -g 5000 ath2
WARNING: You are using the unstable batman branch. If you are interested in
*using* batman get the latest stable release !
Interface activated: ath2
Using interface ath2 with address 5.0.0.1 and broadcast address
5.255.255.255
B.A.T.M.A.N. 0.3-beta (compatibility version 5)
[80] Error - can't set IFFLAGS for gate0: Cannot assign requested
address
[80] Error - can't set IFFLAGS for gate0: Cannot assign requested
address


dmesg output:

Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps
24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_ahb: wifi0: Atheros 2315 WiSoC: mem=0xb000, irq=3
gpio-buttons driver version 0.1.1
batgat: [batgat_ioctl:224] name gate0 index 7
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
batgat: [batgat_ioctl:224] name gate0 index 8
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
batgat: [batgat_ioctl:224] name gate0 index 9
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
batgat: [batgat_ioctl:224] name gate0 index 10
batgat: [batgat_ioctl:244] disconnect daemon
batgat: [packet_recv_thread:508] thread stop
batgat: [batgat_ioctl:256] thread shutdown
batgat: [batgat_ioctl:263] gate shutdown
batgat: [batgat_ioctl:277] device unregistered successfully
r...@openwrt:~#

No iptables rules at all. All policy ACCEPT.

BATGAT dont crash anymore,



Greetings.
Gustavo.


Re: [B.A.T.M.A.N.] BATGAT

2008-09-12 Thread Sven Eckelmann
On Friday 12 September 2008 04:41:33 Marek Lindner wrote:
> On Friday, 12. September 2008 06:18:58 Gustavo Lindberg wrote:
> [...]
> > [80] Error - can't set IFFLAGS for gate0: Cannot assign requested
> > address
> > [80] Error - can't set IFFLAGS for gate0: Cannot assign requested
> > address
>
> It does not crash here but exits because it can't set the IP address.
>
> Please update to the latest versions first.
It is a bug "introduced" by linux v2.6.24-rc1-1-gbada339. I will send a patch 
after I've done some other stuff.

Best regards,
Sven Eckelmann


signature.asc
Description: This is a digitally signed message part.


[B.A.T.M.A.N.] [PATCH] Don't validate hardware address of batgat gate0 device

2008-09-12 Thread Sven Eckelmann
linux v2.6.24-rc1-1-gbada339 introduces a check for valid ethernet mac address.
We don't have such a valid one because it is just a virtual gateway device which
doesn't need such thing. To disable the eth_validate_addr check we can override
the function pointer inside the netdevice structure or just setting it to NULL
to disable it at all.
---
 batman/linux/modules/gateway.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/batman/linux/modules/gateway.c b/batman/linux/modules/gateway.c
index d7af197..11693e2 100644
--- a/batman/linux/modules/gateway.c
+++ b/batman/linux/modules/gateway.c
@@ -527,6 +527,9 @@ static void bat_netdev_setup( struct net_device *dev )
 #endif
dev->mtu = 1471;
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
+#ifdef HAVE_VALIDATE_ADDR
+   dev->validate_addr = NULL;
+#endif
 
priv = netdev_priv( dev );
memset( priv, 0, sizeof( struct gate_priv ) );
-- 
1.6.0.1




Re: [B.A.T.M.A.N.] Batmand dies

2008-09-12 Thread Sven Eckelmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Friday 12 September 2008 14:28:34 Gustavo Lindberg wrote:
> I just tried the last openwrt-kamikaze trunk with the svn v1109 of batman
> on ubnt NS2. Batmand die as follows:
>
>  r...@openwrt:~# batmand -d 4 -g 5000 ath2
> WARNING: You are using the unstable batman branch. If you are interested in
> *using* batman get the latest stable release !
> Interface activated: ath2
> Using interface ath2 with address 5.0.0.1 and broadcast address
> 5.255.255.255
> B.A.T.M.A.N. 0.3-beta (compatibility version 5)
> [80] Error - can't set IFFLAGS for gate0: Cannot assign requested
> address
> [80] Error - can't set IFFLAGS for gate0: Cannot assign requested
> address
> [...]
>
> No iptables rules at all. All policy ACCEPT.
>
> BATGAT dont crash anymore,
Because it never reaches the code section were the crash happened before. 
Please use the patch "Don't validate hardware address of batgat gate0 device" 
to reenable batgat on post 2.6.23 kernels. If you want to help to find the 
problem of the "original" crash, please apply the patch inside this mail.

Best regards,
Sven Eckelmann

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkjKhwgACgkQqQGwKVlMoDupNgCdE/WdiJk8MNUTTY1DiG880ZyM
48cAoKe+Eh6F9GPwJ4SEimVVOP8LQvOd
=2xgS
-END PGP SIGNATURE-
From ee7bcbab9c9f20df8cbb6939804309bfe447f16f Mon Sep 17 00:00:00 2001
From: Sven Eckelmann 
Date: Fri, 12 Sep 2008 17:11:20 +0200
Subject: [PATCH] Add debug code to find nanostation2 batgat crashes.

---
 batman/linux/modules/gateway.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/batman/linux/modules/gateway.c b/batman/linux/modules/gateway.c
index 11693e2..423e06b 100644
--- a/batman/linux/modules/gateway.c
+++ b/batman/linux/modules/gateway.c
@@ -395,7 +395,11 @@ static int packet_recv_thread(void *data)
 		tmp_entry = kmalloc(sizeof(struct free_client_data), GFP_KERNEL);
 		if(tmp_entry != NULL) {
 			tmp_entry->gw_client = client_data;
+			printk("list_add_b; tmp_entry pointers (%p, %p, %p)\n", &tmp_entry->list, tmp_entry->list.prev, tmp_entry->list.next);
+			printk("list_add_b; free_client_list pointers (%p, %p, %p)\n", &free_client_list, free_client_list.prev, free_client_list.next);
 			list_add(&tmp_entry->list,&free_client_list);
+			printk("list_add_a; tmp_entry pointers (%p, %p, %p)\n", &tmp_entry->list, tmp_entry->list.prev, tmp_entry->list.next);
+			printk("list_add_a; free_client_list pointers (%p, %p, %p)\n", &free_client_list, free_client_list.prev, free_client_list.next);
 		} else
 			DBG("can't add free gw_client to free list");
 
@@ -657,7 +661,11 @@ static struct gw_client *get_ip_addr(struct sockaddr_in *client_addr)
 	list_for_each_entry_safe(entry, next, &free_client_list, list) {
 		DBG("use free client from list");
 		gw_client = entry->gw_client;
+		printk("free client_b; entry pointers (%p, %p, %p)\n", &entry->list, entry->list.prev, entry->list.next);
+		printk("free client_b; free_client_list pointers (%p, %p, %p)\n", &free_client_list, free_client_list.prev, free_client_list.next);
 		list_del(&entry->list);
+		printk("free client_a; entry pointers (%p, %p, %p)\n", &entry->list, entry->list.prev, entry->list.next);
+		printk("free client_a; free_client_list pointers (%p, %p, %p)\n", &free_client_list, free_client_list.prev, free_client_list.next);
 		kfree(entry);
 		break;
 	}
-- 
1.6.0.1



Re: [B.A.T.M.A.N.] [PATCH] Don't validate hardware address of batgat gate0 device

2008-09-12 Thread Marek Lindner
On Friday, 12. September 2008 22:59:45 Sven Eckelmann wrote:
> linux v2.6.24-rc1-1-gbada339 introduces a check for valid ethernet mac
> address. We don't have such a valid one because it is just a virtual
> gateway device which doesn't need such thing. To disable the
> eth_validate_addr check we can override the function pointer inside the
> netdevice structure or just setting it to NULL to disable it at all.

I applied that one as well. Hope you also get some sleep while you are not 
sending patches.  :-)

Greetings,
Marek