[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haproxy
Subject:    Re: usesrc clientip not working with linux kernel version >= 3.0.0
From:       Cyril =?utf-8?q?Bont=C3=A9?= <cyril.bonte () free ! fr>
Date:       2011-09-28 13:29:51
Message-ID: 201109281529.52323.cyril.bonte () free ! fr
[Download RAW message or body]

Hi,

Le mercredi 28 septembre 2011 13:31:01, Yang Zhe a écrit :
> After upgrading to linux kernel 3.0.0, my haproxy stopped working.
> 
> By using debug option, I find that transparent with usesrc client
> stopped working. It alters:
> 
> [ALERT]: Cannot bind to source address before connect() for
> proxy %s. Aborting.
> 
> It worked correctly when I was using kernel 2.6.29. So that I checked
> into source code, and find that in src/proto_tcp.c:141,
> bind() returned 97 (EAFNOSUPPORT). I can't understand why it failed
> after successfully setsockopt(..., IP_TRANSPARENT, ...).
> 
> Since perror says "Address family not supported", I find that after
> memset() bind_addr to 0 at src/proto_tcp.c:132, bind_addr.sin_family
> is uninitialized. After I add bind_addr.sin_family = AF_INET; below
> memset(), recompile haproxy then it works again.
> 
> -- System Information:
> Debian Release: wheezy/sid
> APT prefers unstable
> APT policy: (500, 'unstable'), (101, 'experimental')
> Architecture: i386 (i686)
> 
> Kernel: Linux 3.0.0-1-686-pae (SMP w/2 CPU cores)

I encountered a similar issue with httperf nearly 1 month ago. 
I may be wrong for your case but I think it's due to a regression which appeared in \
kernel 2.6.39.3 and later.

Kernel bugzilla is down right now but the bug is referenced here :
https://bugzilla.kernel.org/show_bug.cgi?id=42012

From the netdev archive, a patch has been proposed to fix the regression :
http://www.spinics.net/lists/netdev/msg173766.html

-- 
Cyril Bonté


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic