[Olsr-users] nameservice plugin question/problem

Dave Rivenburg (spam-protected)
Mon Aug 30 07:58:24 CEST 2010


--- 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
===================================================================




      




More information about the Olsr-users mailing list