From owner-freebsd-current@FreeBSD.ORG Tue Jan 1 18:11:43 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EAB7A6D for ; Tue, 1 Jan 2013 18:11:43 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by mx1.freebsd.org (Postfix) with ESMTP id CFB368FC0A for ; Tue, 1 Jan 2013 18:11:42 +0000 (UTC) Received: by mail-ob0-f181.google.com with SMTP id oi10so12316838obb.12 for ; Tue, 01 Jan 2013 10:11:36 -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=JFzEuV3D8BVZ1j/u4++JCcvOKMG0U9t6Icf7EHNxzJs=; b=v4tgrMDaMa7emAWVUg3uco6hTS5weD6hJ0BMS/JsrlMtzUQk/NoBeMACnA4q+MMTvJ jHVrHyY0HcW5B485grDZzMdiHURtOR8La2ypSuyjP2BhtF8f4z9LpDBt4hfsziH/EV+p S+UgQgmEVvp8ltbsZu3+YGIY1DBTXJNQmJUTFk3I+vGBp1MgYQeBaWNEeaaYQfOfrOkK HF3w6w/RvagW7LQGOK9Bevf1uxktf2hTs9qDM/DWyDTd2m4Tu03L3MxqMUzJoL9WiRb9 aj8F3iW4ljr59NGlZEgcLfLO+wkL6ppqXqDCZpFuEsq8fKgMvu5DLAcQM4vWWSGumBss Y8Ag== MIME-Version: 1.0 Received: by 10.182.131.100 with SMTP id ol4mr36405010obb.38.1357063589865; Tue, 01 Jan 2013 10:06:29 -0800 (PST) Received: by 10.76.143.33 with HTTP; Tue, 1 Jan 2013 10:06:29 -0800 (PST) In-Reply-To: References: <201212271705.qBRH5VHU006208@pozo.com> <20130101102255.GA25661@FreeBSD.org> Date: Tue, 1 Jan 2013 10:06:29 -0800 Message-ID: Subject: Re: loopback interface broken on current From: Garrett Cooper To: Mark Atkinson Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2013 18:11:43 -0000 Maybe it's this commit? HTH, -Garrett ------------------------------------------------------------------------ r244678 | glebius | 2012-12-25 05:01:58 -0800 (Tue, 25 Dec 2012) | 17 lines The SIOCSIFFLAGS ioctl handler runs if_up()/if_down() that notify all interested parties in case if interface flag IFF_UP has changed. However, not only SIOCSIFFLAGS can raise the flag, but SIOCAIFADDR and SIOCAIFADDR_IN6 can, too. The actual |= is done not in the protocol code, but in code of interface drivers. To fix this historical layering violation, we will check whether ifp->if_ioctl(SIOCSIFADDR) raised the IFF_UP flag, and if it did, run the if_up() handler. This fixes configuring an address under CARP control on an interface that was initially !IFF_UP. P.S. I intentionally omitted handling the IFF_SMART flag. This flag was never ever used in any driver since it was introduced, and since it means another layering violation, it should be garbage collected instead of pretended to be supported.