[Olsr-users] nameservice plugin question/problem

Henning Rogge (spam-protected)
Mon Aug 30 08:13:35 CEST 2010


On Mon August 30 2010 07:58:24 Dave Rivenburg wrote:
> --- On Sun, 8/29/10, Dave Rivenburg <(spam-protected)> wrote:
> > I am using olsr 0.6.0 with openwrt
> > kamikaze 7.09 on a wrt54g with this configuration:
> > 
> > LoadPlugin "olsrd_nameservice.so.0.3"
> > {
> >     PlParam "sighup-pid-file" "/var/run/dnsmasq.pid"
> >     PlParam "interval" "30"
> >     PlParam "timeout" "300"
> >     PlParam "1.2.3.4" "host1"
> > }
> > 
> > This is what happens: in the /var/run/hosts_olsr file on
> > the router running this configuration the address 1.2.3.4
> > gets assigned to host1, which is what I expected. 
> > However, on remote nodes (using the same configuration only
> > without the host1 line) the address for host1 is set to the
> > address of the router instead of 1.2.3.4.
> 
> I found the problem, and it may be a compiler bug.  This is getting into
> olsr-dev territory, but I'll finish what I started here before moving on. 
> The comipler in question is "mipsel-linux-gcc (GCC) 3.4.6 (OpenWrt-2.0)"
> and the fix to nameservice.c is:
> 
> 
> ===================================================================
> --- nameservice.c
> +++ nameservice.c
> @@ -1105,12 +1105,12 @@
>        entry = list2db(list_node);
> 
>        for (name = entry->names; name != NULL; name = name->next) {
> -        struct ipaddr_str strbuf;
> +        struct ipaddr_str strbuf, strbuf2;
>          OLSR_PRINTF(6, "%s\t%s%s\t#%s\n", olsr_ip_to_string(&strbuf,
> &name->ip), name->name, my_suffix, -                   
> olsr_ip_to_string(&strbuf, &entry->originator)); +                   
> olsr_ip_to_string(&strbuf2, &entry->originator));
> 
>          fprintf(hosts, "%s\t%s%s\t# %s\n", olsr_ip_to_string(&strbuf,
> &name->ip), name->name, my_suffix, -               
> olsr_ip_to_string(&strbuf, &entry->originator));
> +                olsr_ip_to_string(&strbuf2, &entry->originator));
> 
>  #ifdef MID_ENTRIES
>          // write mid entries
> ===================================================================
That's not a compiler bug, that's a bug in the plugin. It use the same output 
buffer for two IP addresses.

I have opened a bugreport in the bugtracker and pushed your fix into the 
repository .

http://olsr.org/bugs/view.php?id=15
http://olsr.org/git/?p=olsrd.git;a=commitdiff;h=373bc743f2a7d918407e807207cb73892f812859

Can you check if the output of the new version is better than the old one ?

Henning Rogge

-- 
Diplom-Informatiker Henning Rogge , Fraunhofer-Institut für
Kommunikation, Informationsverarbeitung und Ergonomie FKIE
Kommunikationssysteme (KOM)
Neuenahrer Straße 20, 53343 Wachtberg, Germany
Telefon +49 228 9435-961,   Fax +49 228 9435 685
mailto:(spam-protected) http://www.fkie.fraunhofer.de
GPG: E1C6 0914 490B 3909 D944 F80D 4487 C67C 55EC CFE0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.olsr.org/pipermail/olsr-users/attachments/20100830/0c16d01d/attachment.sig>


More information about the Olsr-users mailing list