From owner-freebsd-net@FreeBSD.ORG Thu Aug 1 16:34:32 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BBF30D0D for ; Thu, 1 Aug 2013 16:34:32 +0000 (UTC) (envelope-from rnewpol@panasas.com) Received: from natasha.panasas.com (natasha.panasas.com [67.152.220.90]) by mx1.freebsd.org (Postfix) with ESMTP id 819382E03 for ; Thu, 1 Aug 2013 16:34:31 +0000 (UTC) Received: from zenyatta.panasas.com (zenyatta.int.panasas.com [172.17.28.63]) by natasha.panasas.com (8.13.1/8.13.1) with ESMTP id r71GMpSM031898 for ; Thu, 1 Aug 2013 12:22:51 -0400 Received: from ZENYATTA.int.panasas.com ([fe80::44ca:f0e1:b97e:bf79]) by zenyatta.int.panasas.com ([fe80::44ca:f0e1:b97e:bf79%15]) with mapi id 14.01.0438.000; Thu, 1 Aug 2013 12:22:51 -0400 From: "Newpol, Richard" To: "freebsd-net@freebsd.org" Subject: Adding an address to a downed LAGG interface breaks it? Thread-Topic: Adding an address to a downed LAGG interface breaks it? Thread-Index: Ac6O0kNU3I+mB/omSF2T80LhN/f9IA== Date: Thu, 1 Aug 2013 16:22:50 +0000 Message-ID: <1A778AD3F807B340B7EB1BD1B9C196773D655FE6@zenyatta.int.panasas.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.28.30] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Thu, 01 Aug 2013 16:34:32 -0000 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 t= o bring the interface UP it can't reach the desired networks. Turns out that the problem occurs because the lagg driver silently passes t= he SIOCSIFADDR ioctl to the "ether_ioctl" handler, which in turn always set= s the IFF_UP flag. While this is usually ok (since ifconfig
implies UP with the= first assigned address anyway), the lagg driver does not have the proper h= andling 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). So my first question - is this a known problem, or has it been addressed in= some other way? Secondly, I can think of two ways to fix this, and was wondering what are t= he implications. The first way would be for the lagg driver to correctly br= ing itself up when the first address is added to it. The second way would b= e for the lagg driver to preserve the state of IFF_FLAG when handling SIOCS= IFADDR. I like the second way because it is less of an overall behaviour ch= ange from the current, but the first way seems more correct. Rich Newpol Panasas