[Olsr-dev] httpinfo IPv6 patch

Alina Friedrichsen (spam-protected)
Mon Nov 17 18:18:22 CET 2008


Hello Bernd!

> ad "double free bug": I fail to see the bug.

In the development branch at the jump mark close_connection abuf_free() is called. But this may happen before abuf_init() was called. In my glibc it ends up in a double free() warning. Under other conditions a segfault is maybe the result. With my patch abuf_init() is called, before any "goto close_connection" instruction.

> I actually like the s/allowed_net/ip_prefix_list/.
> We could eventually kill the struct allowed_net completely if all uses
> are converted.

ACK

> Since I have only pure theoretical knowledge about IPv6 (and that is
> pretty limited to the usual basic stuff like formats etc.) but I'm
> curious:
> ----  snip  ---- 
>       if(ip_version == AF_INET) {
>         memmove(&net.v6.s6_addr[12], &net.v4.s_addr, sizeof(in_addr_t));
>         memset(&net.v6.s6_addr[0], 0x00, 10 * sizeof(uint8_t));
>         memset(&net.v6.s6_addr[10], 0xff, 2 * sizeof(uint8_t));
>         prefix_len += 96;
>       }
> ----  snip  ----
> That seems to implement some IPv4-to-IPv6 address mapping.
> Is this something somewhat standardized? Are there more "competing"
> mapping schemes?
> Is there some concensus about IPv4-to-IPv6 address
> mapping/interoperation?

On linux systems an IPv6 socket binds per default (if /proc/sys/net/ipv6/bindv6only is 0) on the IPv4 and IPv6 port. If now an IPv4 client connects to the IPv6 server the server get not an IPv4 address but an v4 mapped IPv6 address. This code above converts an IPv4 address to the corresponding v4 mapped IPv6 address.
So if you write in the config
PlParam "Host" "192.168.1.42"
the client IP address can connect to the plugin too, if you run the olsrd and plugin server in the IPv6 mode.

> I had to add a set of braces here (or in the #define above) to make it
> compile warning-free.
> Do we have a problem somewhere?

Thanks for the bugreport. I have attached a revised patch which compiles on my gcc 4.3.2 with no warnings.

cu
Alina

-- 
Sensationsangebot nur bis 30.11: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httpinfo_ipv6-0.5.6-r2.patch
Type: text/x-patch
Size: 13551 bytes
Desc: not available
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20081117/9e14f59d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httpinfo_ipv6-edc6d6e703eb.patch
Type: text/x-patch
Size: 13754 bytes
Desc: not available
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20081117/9e14f59d/attachment-0001.bin>


More information about the Olsr-dev mailing list