Date: Fri, 13 Oct 2006 15:13:42 +0300 From: Ari Suutari <ari@suutari.iki.fi> To: Tom Judge <tom@tomjudge.com> Cc: freebsd-stable@freebsd.org Subject: Re: carp0 interface goes down on 6.2-PRERELEASE Message-ID: <452F82F6.4010902@suutari.iki.fi> In-Reply-To: <452F800A.9040408@tomjudge.com> References: <452E2151.80500@suutari.iki.fi> <452E27B4.2030709@tomjudge.com> <452E2AA0.4080702@suutari.iki.fi> <452F7BF2.5080206@suutari.iki.fi> <452F800A.9040408@tomjudge.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
Tom Judge wrote:
> Ari Suutari wrote:
>> Ari Suutari wrote:
>>> I have now tested with real hardware (ethernet is fxp0) and
>>> under VmWare (ethernet is lnc0). Same problem on both.
>>
>> I'll have to correct this. Carp works with fxp0. Problem is
>> only under vmware, which makes me more and more suspect
>> that it is because lnc0 does not support link state reporting
>> (it seems to be present on only a few drivers).
>>
> I do remember seeing this problem when developing some systems in vmware
> that the carp interfaces where always in INIT when the system booted. I
> added a small rc script to for the interfaces up using 'ifconfig carp0
> up' which seemed to make the interfaces come up however if on system is
> unplugged from the network it will automatically put itself into the
> master state until it can talk to the other servers in the carp group.
>
I already found the problem, it is in netinet/ip_carp.c.
Since lnc driver doesn't support link state, the state is
always LINK_STATE_UNKNOWN and carp code doesn't understand this.
Following patch fixes it for me:
cvs diff: Diffing .
Index: ip_carp.c
===================================================================
RCS file: /opt/freebsd-cvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.27.2.8
diff -c -r1.27.2.8 ip_carp.c
*** ip_carp.c 25 Sep 2006 13:01:59 -0000 1.27.2.8
--- ip_carp.c 13 Oct 2006 11:11:08 -0000
***************
*** 2116,2122 ****
{
CARP_SCLOCK_ASSERT(sc);
! if (sc->sc_carpdev->if_link_state != LINK_STATE_UP ||
!(sc->sc_carpdev->if_flags & IFF_UP)) {
sc->sc_flags_backup = SC2IFP(sc)->if_flags;
SC2IFP(sc)->if_flags &= ~IFF_UP;
--- 2116,2122 ----
{
CARP_SCLOCK_ASSERT(sc);
! if (sc->sc_carpdev->if_link_state == LINK_STATE_DOWN ||
!(sc->sc_carpdev->if_flags & IFF_UP)) {
sc->sc_flags_backup = SC2IFP(sc)->if_flags;
SC2IFP(sc)->if_flags &= ~IFF_UP;
Ari S.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?452F82F6.4010902>
