From owner-svn-src-all@FreeBSD.ORG Fri Jan 9 13:14:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F27A03AC; Fri, 9 Jan 2015 13:14:55 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97D3033C; Fri, 9 Jan 2015 13:14:55 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id bs8so2178228wib.4; Fri, 09 Jan 2015 05:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mGHR+dgTgv6GYndhCp5vExLKmvtDJ+Ie6s05TzJAiMU=; b=ALkw0/eG5XwgkNZsecJP0rHHZioB0k5ndy3e8NzO06ZTkHyhEm/fMzkrEc54Z4ufSc ranKerCo1m1tkFoQTa6EDiwM7B2Lb90maFatVp1kpCBmg/Zfg2WUSMTzRvvjM4dqs7RT Spju+661EWqEsFsEX3IVqH9fFBQBqMC3ZWWicjq4tSRO7Ujli3mf6Cqnru3cVPoAwxX8 slHi7WTdpjIHRpjYxulFN6fFv7DBaDlja0ybbbDVwSFQ1xAPpAzq+JiiDmcNxaBBc/TN I0Qfu+LEFZf91+IjBdIVl192m4RsccPAY6jnpV12JmMFSkPYEk8PSteOwpR+7BJarTq+ onEg== MIME-Version: 1.0 X-Received: by 10.180.74.108 with SMTP id s12mr5202912wiv.28.1420809294033; Fri, 09 Jan 2015 05:14:54 -0800 (PST) Received: by 10.217.60.135 with HTTP; Fri, 9 Jan 2015 05:14:53 -0800 (PST) In-Reply-To: <20150107205203.GI15484@FreeBSD.org> References: <201501061307.t06D7E0a001358@svn.freebsd.org> <20150107205203.GI15484@FreeBSD.org> Date: Fri, 9 Jan 2015 11:14:53 -0200 Message-ID: Subject: Re: svn commit: r276751 - head/sys/netinet From: Luiz Otavio O Souza To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: Luiz Otavio O Souza , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 13:14:56 -0000 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