Re: [Babel-users] babel freebsd issues

2012-08-02 Thread Juliusz Chroboczek
 Thanks for the fix! Should we add the patch to the FreeBSD port or wait
 for the next release?

Difficult to say.  I'm waiting for feedback on another bug report, and
I'll make a 1.3.* release with both fixes.  Unfortunately, I cannot give
you an ETA -- it depends on the reporter for the other bug.

If you want to cherry-pick the change, it's commit 724b40.

-- Juliusz

___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users


Re: [Babel-users] babel freebsd issues

2012-08-02 Thread Gregoire Henry
Hi, 
 
  I have also found a significant problem with the mesh implementation in
  FreeBSD. It seems that after a few announcements, the FreeBSD babeld
  will start announcing routes it added to its routing from the mesh back
  to the mesh as native routes.
 
  What happens if you try to revert the following patch: 
 
 Kernel_socket: do not use the RTF_PROTO2 flag. 
 
 It stops happening.

Good news.

 Why was that change done in the first place? It looked like a good
 idea. :)

The original introduction of the RTF_PROTO2 flag was to easily filter in the 
kernel_routes function the routes that were installed by babel. On linux, 
babel's route are installed in a distinct route table; hence filtering is easy 
and babel do not compare the routes returnes by kernel_routes with this own 
internal table.

The removal of this flag is due to a bug on MacOS X: when the flag is set, 
atomic route changes (a.k.a. ROUTE_MODIFY) fail miserabily.

Then, on a late night, I probably forgot to implement another filtering 
mechanism. I don't know yet what to do:

- revert the patch and don't use atomic route change on OS X (and probably old 
BSD)
- implement another filtering mechanism (by comparing each route to the babel 
internal routing table ? by accepting only routes with a static flag ?)

Any ideas ? Juliusz ?

Regards,
Grégoire

___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Re: [Babel-users] babel freebsd issues

2012-08-02 Thread Antoine Beaupré
On 2012-08-02, Gregoire Henry wrote:
 Then, on a late night, I probably forgot to implement another filtering 
 mechanism. I don't know yet what to do:

 - revert the patch and don't use atomic route change on OS X (and probably 
 old BSD)
 - implement another filtering mechanism (by comparing each route to the babel 
 internal routing table ? by accepting only routes with a static flag ?)

Well, just to make things a bit more confusing - things are stable again
here with the patch in. The routes don't have the #2 flag yet do not get
added back into babel.

No idea what's going on.

A.

-- 
feature, n: a documented bug | bug, n: an undocumented feature
- Mario S F Ferreira li...@freebsd.org


pgpiaoi0OjPKE.pgp
Description: PGP signature
___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Re: [Babel-users] babel freebsd issues

2012-08-01 Thread Antoine Beaupré
On 2012-07-31, Juliusz Chroboczek wrote:
 @@ -71,7 +78,7 @@ getword(int c, char **token_r, gnc_t gnc, void
 *closure)
  
  c = skip_whitespace(c, gnc, closure);
  if(c  0)
 -return c;
 +return -2;
  if(c == '' || c == '\n')
  return -2;
  do {

Thanks for the fix! Should we add the patch to the FreeBSD port or wait
for the next release?

-- 
Wherever they's a fight so hungry people can eat, I'll be there.
Wherever they's a cop beatin' up a guy, I'll be there.
If Casy knowed, why, I'll be in the way guys yell when they're mad an'
I'll be in the way kids laugh when they're hungry an' they know
supper's ready. An' when our folks eat the stuff they raise an' live
in the house they build, why I'll be there.
- John Steinbeck, The Grapes of Wrath


pgpvoK5TKnbdH.pgp
Description: PGP signature
___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Re: [Babel-users] babel freebsd issues

2012-08-01 Thread Antoine Beaupré
On 2012-07-31, Gregoire Henry wrote:
 Hi,

 I have also found a significant problem with the mesh implementation in
 FreeBSD. It seems that after a few announcements, the FreeBSD babeld
 will start announcing routes it added to its routing from the mesh back
 to the mesh as native routes.

 What happens if you try to revert the following patch: 

Kernel_socket: do not use the RTF_PROTO2 flag. 

It stops happening.

Why was that change done in the first place? It looked like a good
idea. :)

A.
-- 
Marijuana grows naturally on the planet.
Mushrooms grows naturally on the planet.
Don't you think making nature against the law is a bit... unnatural?
- Bill Hicks


pgpedr4fJ4ups.pgp
Description: PGP signature
___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

[Babel-users] babel freebsd issues

2012-07-31 Thread Antoine Beaupré
On 2012-07-29, Antoine Beaupré anar...@anarcat.ath.cx wrote:
 roadkiller# babeld -d9 -C 'redistribute metric 128' -C 'interface vr2
 wired' vr2
 Segmentation fault (core dumped)

 Backtrace:

Here's one with debugging symbols:

#0  0x2810c76c in free () from /lib/libc.so.7
(gdb) bt
#0  0x2810c76c in free () from /lib/libc.so.7
#1  0x080536f0 in getbool (c=-2, int_r=0xbfbfe540, gnc=Variable gnc is not 
available.
) at configuration.c:173
#2  0x0805407a in parse_config (gnc=0x80532f4 gnc_string, closure=0xbfbfe570) 
at configuration.c:428
#3  0x0805430b in parse_config_from_string (string=0xbfbfe999 interface vr2 
wired) at configuration.c:630
#4  0x08049b54 in main (argc=7, argv=0xbfbfe808) at babeld.c:221

I have also found a significant problem with the mesh implementation in
FreeBSD. It seems that after a few announcements, the FreeBSD babeld
will start announcing routes it added to its routing from the mesh back
to the mesh as native routes.

For example, say I have the following machines:

 * roadkiller: 172.16.0.1/12, FreeBSD 8.2 Babeld 1.3.3
 * boulette: 172.16.0.2/12, OpenWRT trunk Babeld 1.3.2-1
 * carton: 172.16.1.1/12, OpenWRT trunk Babeld 1.3.2-1
 * angela: 172.16.0.42/12, Debian Wheezy Babeld 1.3.1-1

roadkiller has a wired link to boulette, which has a adhoc wifi link to
carton, which has a adhoc link to angela. Running babeld on boulette,
carton and angela works fine and they exchange point to point but also
network routes without problems.

However, once roadkiller joins in, things start to become a bit
weird. After a while (a few iterations in the announcements, say 30
seconds), roadkiller has added the route to boulette (172.16.0.2/32) to
its routing table, but then goes around and announce that route as its
own:

172.16.0.2/32 metric 0 (exported)

This of course gets added to the other nodes in the network, polluting
their routing table:

172.16.0.2  172.16.0.1  255.255.255.255 UGH   0  00 br-lan

Since even boulette gets that route in, this totally fails.

The configuration on roadkiller is:

redistribute allow
in ip 0.0.0.0/0 le 0 deny

Assigning a metric to 'redistribute' (say metric 128) mitigates the
problem. I can also think that explicitely listing the routes to be
announced would fix the problem.

Finally, Babeld doesn't seem to drop its route from the routing table
when interrupted (control-c).

I have filed a PR for the update of the port to 1.3.3. See:

http://www.freebsd.org/cgi/query-pr.cgi?pr=170291

A.

PS: sorry to pack everything in one message here. please CC me as I'm
not on the list (yet?)

-- 
Rock journalism is people who can't write interviewing people who can't
talk for people who can't read.
- Frank Zappa


pgpVZDmoEIdlG.pgp
Description: PGP signature
___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Re: [Babel-users] babel freebsd issues

2012-07-31 Thread Juliusz Chroboczek
 Here, the value of c is in fact -1, but optimisations hide it.  The
 culprit is gnc_string which returns -1 in case of error, but every
 error checking in this file checks (c  -1) for some reason.

[...]

 -return -1;
 +return -2;

The convention in this file is that -1 signals EOF, while -2 signals an
error.  So the return value is correct, it's the handling of EOF that's
broken.

I'll look at it later.

-- Juliusz

___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users


Re: [Babel-users] babel freebsd issues

2012-07-31 Thread Gregoire Henry
Hi,

 I have also found a significant problem with the mesh implementation in
 FreeBSD. It seems that after a few announcements, the FreeBSD babeld
 will start announcing routes it added to its routing from the mesh back
 to the mesh as native routes.

What happens if you try to revert the following patch: 

   Kernel_socket: do not use the RTF_PROTO2 flag. 

Regards,
Gregoire

___
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users