[Olsr-users] OLSR bug on OpenBSD

Michel Blais (spam-protected)
Thu Nov 17 19:30:55 CET 2011


Hi Markus,

It look like to work fine. Here a test I've done :

olsr subnet is 10.255.255.0/24
FreeBSD node is 10.255.255.201
openwrt node 10.255.255.101 have hna 192.168.101.0/24
openwrt node 10.255.255.102 have hna 192.168.102.0/24
openwrt node 10.255.255.103 have hna 192.168.103.0/24

I deleted hna 192.168.103.0/24 from 10.255.255.103 and added it to 
10.255.255.102 instead. Here the output from olsr with nofork :

set netmask to 32### Route debug add_Del_route:
KERN: 1 Deleting 192.168.102.0/24 via 10.255.255.102
check for gateway 192.168.102.0 != 10.255.255.102add GATEWAY to flags
gateway ip added
set netmask to 24### Route debug add_Del_route:
KERN: 0 Adding 10.255.255.103/32 from 10.255.255.103 via 10.255.255.103, 
cost 8.793, metric 1, v 2510
add HOST to flags
check for gateway 10.255.255.103 != 10.255.255.103mac as gateway
rtfhost
set netmask to 32### Route debug add_Del_route:
KERN: 0 Adding 10.255.255.102/32 from 10.255.255.102 via 10.255.255.102, 
cost 8.793, metric 1, v 2514
add HOST to flags
check for gateway 10.255.255.102 != 10.255.255.102mac as gateway
rtfhost
set netmask to 32### Route debug add_Del_route:
KERN: 1 Adding 192.168.102.0/24 from 10.255.255.102 via 10.255.255.102, 
cost 8.793, metric 1, v 2514
check for gateway 192.168.102.0 != 10.255.255.102add GATEWAY to flags
gateway ip added
set netmask to 24### Route debug add_Del_route:
KERN: 1 Adding 192.168.103.0/24 from 10.255.255.102 via 10.255.255.102, 
cost 8.793, metric 1, v 2514
check for gateway 192.168.103.0 != 10.255.255.102add GATEWAY to flags
gateway ip added
set netmask to 24

routing table before hna change :

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            216.113.32.254     UGS         0    11523    re0
10.255.255.0       link#3             U           9       40    em0
10.255.255.101/32  00:30:18:a0:f5:35  U           0       49    em0
10.255.255.102/32  00:30:18:a0:f5:35  U           0        1    em0
10.255.255.103/32  00:30:18:a0:f5:35  U           0        2    em0
olsrtestfbsd       link#3             UHS         0        0    lo0
localhost          link#7             UH          0        0    lo0
192.168.3.0        link#1             U           2     1456    re0
192.168.3.223      link#1             UHS         0        0    lo0
192.168.101.0      10.255.255.101     UG          0        0    em0
192.168.102.0      10.255.255.102     UG          0        0    em0
192.168.103.0      10.255.255.103     UG          0        0    em0
216.113.32.248/29  link#1             U           0        0    re0
216.113.32.250     link#1             UHS         0        0    lo0

routing table after hna change :

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            216.113.32.254     UGS         0    11536    re0
10.255.255.0       link#3             U          12       52    em0
10.255.255.101/32  00:30:18:a0:f5:35  U           0       49    em0
10.255.255.102/32  00:30:18:a0:f5:35  U           0        0    em0
10.255.255.103/32  00:30:18:a0:f5:35  U           0        0    em0
olsrtestfbsd       link#3             UHS         0        0    lo0
localhost          link#7             UH          0        0    lo0
192.168.3.0        link#1             U           4     2065    re0
192.168.3.223      link#1             UHS         0        0    lo0
192.168.101.0      10.255.255.101     UG          0        0    em0
192.168.102.0      10.255.255.102     UG          0        0    em0
192.168.103.0      10.255.255.102     UG          0        0    em0
216.113.32.248/29  link#1             U           0        0    re0
216.113.32.250     link#1             UHS         0        0    lo0

I will try it in a production environnement with 25 neighbors and around 
600 or 700 dynamic route to check if it's still right.

Did you make a patch ? I know it's a ugly fix but I would like to also 
try it on OpenBSD to check if the problem is really the same.

Thanks

Michel

Le 2011-11-16 19:47, Markus Kittenberger a écrit :
> hmm i think i found the bug, and added a ugly bugfix right on your 
> testsystem
> (in /usr/ports/net/olsrd/work/olsrd-0.6.2/)
> and did an gmake & gmake install afterwards
>
> infact the bug is not even really in the bsd specific code,.. #1
> (but i added (beside many debugoutput on stderr) a fix/workaround 
> there, until i decided how to really fix this,..)
>
> please test if it really works now,
>
> Markus
>
> #1 it seems that (os_unspecific) olsr_rt_flags() function does not 
> correctly set the GATEWAY flag,... (it comes to different conslusion 
> if a route gets deleted as if its added *G)
>
> and as the bsd code not only passes this flag to the kernel (where a 
> wrong flag would be bad anyways)
> but also checks for this flag itself, to decide whether it includes 
> the gateway ip to the routing socket message or not, it fails to 
> delete the route,..
>
> as afair the linux specific routing code of olsrd evaluates itself if 
> there is a gateway, and towards kernel anyways always set RTA_GATEWAY 
> routing flag (at least since ON_LINK)
> so it is not affected by this bug of the olsr_rt_flags() function,..
>
> On Wed, Nov 16, 2011 at 12:10 AM, Michel Blais 
> <(spam-protected) <mailto:(spam-protected)>> wrote:
>
>     Hi Markus,
>
>     I build a small network with
>     3 OLSR v0.6.1 on OpenWRT (paquage from opkg install)
>     1 OLSR v0.6.1 on FreeBSD 8.2 (paquagee from freebsd install with
>     pkg_add -r)
>
>     I saw those errors on the FreeBSD with -nofork
>
>     Cannot write to routing socket: (rtm_errno= 0x0) (last error
>     message: No such process)
>      Failed on Deleting 10.255.255.102/32 <http://10.255.255.102/32>
>     via 10.255.255.101
>
>     Cannot write to routing socket: (rtm_errno= 0x0) (last error
>     message: No such process)
>      Failed on Deleting 10.255.255.103/32 <http://10.255.255.103/32>
>     via 10.255.255.102
>
>     Cannot write to routing socket: (rtm_errno= 0x0) (last error
>     message: No such process)
>      Failed on Deleting 10.255.255.101/32 <http://10.255.255.101/32>
>     via 10.255.255.103
>
>     If I look at the routing table
>
>     olsrtestfbsd# netstat -r
>     Routing tables
>
>     Internet:
>     Destination        Gateway            Flags    Refs      Use
>      Netif Expire
>     10.255.255.0       link#3             U           1        0    em0
>     olsrtestfbsd       10.255.255.103     UGH         0        0    em0 =>
>     10.255.255.101/32 <http://10.255.255.101/32>  00:30:18:a0:f5:35  U
>               0        0    em0
>     10.255.255.102     10.255.255.103     UGH         0        0    em0 =>
>     10.255.255.102/32 <http://10.255.255.102/32>  00:30:18:a0:f5:35  U
>               0        0    em0
>     10.255.255.103     10.255.255.102     UGH         0        0    em0 =>
>     10.255.255.103/32 <http://10.255.255.103/32>  00:30:18:a0:f5:35  U
>               0        0    em0
>     10.255.255.201     link#3             UHS         0        0    lo0
>     localhost          link#7             UH          0        2    lo0
>     192.168.3.0        link#1             U           1     1336    re0
>     192.168.3.223      link#1             UHS         0        0    lo0
>
>     If I look at http_info :
>
>     Destination    Gateway    Metric    ETX    Interface
>     10.255.255.101    10.255.255.101    1    1.000    em0
>     10.255.255.102    10.255.255.102    1    1.000    em0
>     10.255.255.103    10.255.255.103    1    1.000    em0
>
>     So the same error happen on FreeBSD. I will try to check if older
>     version can be install with pkg_add or build them.
>
>     I could give acces tomorrow to the FreeBSD if somebody want to
>     test it.
>
>     Michel
>
>


-- 
Michel Blais
Administrateur réseau / Network administrator
Targo Communications
www.targo.ca
514-448-0773


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.olsr.org/pipermail/olsr-users/attachments/20111117/a08703e6/attachment.html>


More information about the Olsr-users mailing list