Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jan 2015 11:14:53 -0200
From:      Luiz Otavio O Souza <loos.br@gmail.com>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        Luiz Otavio O Souza <loos@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r276751 - head/sys/netinet
Message-ID:  <CAJ8CS7qJWzwdRrYRT4EEQ%2Bwm3XynvebdW2zMMLpX=d%2BdbouKwA@mail.gmail.com>
In-Reply-To: <20150107205203.GI15484@FreeBSD.org>
References:  <201501061307.t06D7E0a001358@svn.freebsd.org> <20150107205203.GI15484@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 7, 2015 at 6:52 PM, Gleb Smirnoff wrote:
> On Tue, Jan 06, 2015 at 01:07:14PM +0000, Luiz Otavio O Souza wrote:
> L> Author: loos
> L> Date: Tue Jan  6 13:07:13 2015
> L> New Revision: 276751
> L> URL: https://svnweb.freebsd.org/changeset/base/276751
> L>
> L> Log:
> L>   Remove the check that prevent carp(4) advskew to be set to '0'.
> L>
> L>   CARP devices are created with advskew set to '0' and once you set it to
> L>   any other value in the valid range (0..254) you can't set it back to zero.
> L>
> L>   The code in question is also used to prevent that zeroed values overwrite
> L>   the CARP defaults when a new CARP device is created.  Since advskew already
> L>   defaults to '0' for newly created devices and the new value is guaranteed
> L>   to be within the valid range, it is safe to overwrite it here.
> L>
> L>   PR:                194672
> L>   Reported by:       cmb@pfsense.org
> L>   In collaboration with:     garga
> L>   Tested by: garga
> L>   MFC after: 2 weeks
>
> Please correct me if I am wrong, but after this change any SIOCSVH will reset
> the advskew to 0.
>
> For example, please try to:
>
> ifconfig igb0 vhid 1 advskew 100
> ifconfig igb0 vhid 1 pass foobar
>
> Now let's check the advskew:
>
> ifconfig igb0

Only if the SIOCSVH request is not initialized with data from SIOCGVH.

ifconfig (at setcarp_callback()) will always read the existing values
before issuing the SIOCSVH with the new values and this is what makes
my change safe:

# ifconfig em0 vhid 1 advskew 100 192.168.100.1/24 alias
# ifconfig em0 | grep carp
        carp: MASTER vhid 1 advbase 1 advskew 100
# ifconfig em0 vhid 1 pass foobar
# ifconfig em0 | grep carp
        carp: MASTER vhid 1 advbase 1 advskew 100
# ifconfig em0 vhid 1 advbase 5
# ifconfig em0 | grep carp
        carp: MASTER vhid 1 advbase 5 advskew 100
# ifconfig em0 vhid 1 advskew 0
# ifconfig em0 | grep carp
        carp: MASTER vhid 1 advbase 5 advskew 0

Luiz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ8CS7qJWzwdRrYRT4EEQ%2Bwm3XynvebdW2zMMLpX=d%2BdbouKwA>