clone 351269 -1
reassign -1 libdumbnet 1.8-1.3
severity -1 important
retitle -1 libdumbnet: route_add() and route_delete() broken in 1.8
tags -1 patch fixed-upstream
blocks -1 351269
thanks

On Fri, Feb 03, 2006 at 01:36:03PM -0500, Michael Richters wrote:
> Package: fragroute
> Version: 1.2-7
> Severity: grave
> 
> I'm using the default fragroute config file.  My local subnet is
> 172.16.0.0/24.  Here is a transcript of a shell session:

> # fragroute 172.16.0.1
> fragroute: couldn't delete loopback route
> fragroute: couldn't initialize tunnel interface: Invalid argument

Hi,

this is because libdumbnet1 version 1.8 has a bug in addr_btos(),
called by route_add() and route_delete() at fragroute initialization
time. This bug was present in 1.7 also, but the code was not called
from the route_* functions.

I'm cloning this as a severity 'important' bug against the libdumbnet
package and attaching a patch stolen from upstream 1.9 (the current
version is 1.11). A better fix would obviously be to upgrade to a new
upstream version.

With a patched version of libdumbnet1, a recompiled fragroute seems to
work as expected. I'm not sure why exactly a recompile is needed, but
at least libevent1 has had several releases after fragroute was last
uploaded.

Cheers,
-- 
Niko Tyni       [EMAIL PROTECTED]
--- libdumbnet-1.8/src/addr.c   2006-04-25 23:47:39.309965509 +0300
+++ libdumbnet-1.8-fixed/src/addr.c     2006-04-25 23:40:33.994910466 +0300
@@ -341,7 +341,7 @@
        union sockunion *so = (union sockunion *)sa;
 
 #ifdef HAVE_SOCKADDR_IN6
-       if (bits > IP_ADDR_BITS && bits < IP6_ADDR_BITS) {
+       if (bits > IP_ADDR_BITS && bits <= IP6_ADDR_BITS) {
                memset(&so->sin6, 0, sizeof(so->sin6));
 #ifdef HAVE_SOCKADDR_SA_LEN
                so->sin6.sin6_len = IP6_ADDR_LEN + (bits / 8) + (bits % 8);
@@ -350,7 +350,7 @@
                return (addr_btom(bits, &so->sin6.sin6_addr, IP6_ADDR_LEN));
        } else
 #endif
-       if (bits < IP_ADDR_BITS) {
+       if (bits <= IP_ADDR_BITS) {
                memset(&so->sin, 0, sizeof(so->sin));
 #ifdef HAVE_SOCKADDR_SA_LEN
                so->sin.sin_len = IP_ADDR_LEN + (bits / 8) + (bits % 8);

Reply via email to