From owner-freebsd-net@FreeBSD.ORG Sun Aug 4 19:05:12 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B8567D70 for ; Sun, 4 Aug 2013 19:05:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id A284A246B for ; Sun, 4 Aug 2013 19:05:12 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:c1a4:5299:ada4:3d28] (unknown [IPv6:2601:9:4d00:119:c1a4:5299:ada4:3d28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 6A42B3981E; Sun, 4 Aug 2013 12:05:12 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Adding an address to a downed LAGG interface breaks it? From: Rui Paulo In-Reply-To: <1A778AD3F807B340B7EB1BD1B9C196773D655FE6@zenyatta.int.panasas.com> Date: Sun, 4 Aug 2013 12:05:11 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1A778AD3F807B340B7EB1BD1B9C196773D655FE6@zenyatta.int.panasas.com> To: "Newpol, Richard" X-Mailer: Apple Mail (2.1508) Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2013 19:05:12 -0000 On 1 Aug 2013, at 09:22, "Newpol, Richard" wrote: > All, > We seem to have discovered a problem that occurs when adding an = address (or alias) to a DOWNed lagg interface. After adding an address, = when you try to bring the interface UP it can't reach the desired = networks. >=20 > Turns out that the problem occurs because the lagg driver silently = passes the SIOCSIFADDR ioctl to the "ether_ioctl" handler, which in turn = always sets the IFF_UP flag. >=20 > While this is usually ok (since ifconfig
implies UP = with the first assigned address anyway), the lagg driver does not have = the proper handling to actually change state to UP on the first address, = so it ends up in an inconsistent state. Then, when the user eventually = does an "ifconfig lagg up" the default subnet routes are not added = (because the "interface up" code sees that IFF_UP is already set). >=20 > So my first question - is this a known problem, or has it been = addressed in some other way? >=20 > Secondly, I can think of two ways to fix this, and was wondering what = are the implications. The first way would be for the lagg driver to = correctly bring itself up when the first address is added to it. The = second way would be for the lagg driver to preserve the state of = IFF_FLAG when handling SIOCSIFADDR. I like the second way because it is = less of an overall behaviour change from the current, but the first way = seems more correct. After you add the first address, you said it comes to an inconsistent = state. Can you clarify? The first approach seems like the right fix but I don't know much about = the problem. The second way breaks the POLA because you're special = casing lagg just to work around a bug. -- Rui Paulo